40 unsigned int width = 0x10;
46 fprintf(stream,
"%s%s, %d bytes (0x%x)\n", timebuf, text,
47 (
int)size, (
int)size);
51 fprintf(stream,
"%04x: ", (
int)i);
55 for(c = 0; c <
width; c++)
57 fprintf(stream,
"%02x ", ptr[i + c]);
62 for(c = 0; (c <
width) && (i + c < size); c++) {
65 (i + c + 1 < size) && (ptr[i + c] == 0x0D) &&
66 (ptr[i + c + 1] == 0x0A)) {
70 fprintf(stream,
"%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80)) ?
74 (i + c + 2 < size) && (ptr[i + c + 1] == 0x0D) &&
75 (ptr[i + c + 2] == 0x0A)) {
101 timestr = &timebuf[0];
110 now = localtime(&secs);
111 snprintf(timebuf,
sizeof(timebuf),
"%02d:%02d:%02d.%06ld ",
112 now->tm_hour, now->tm_min, now->tm_sec, (
long)tv.
tv_usec);
117 fprintf(stderr,
"%s== Info: %s", timestr, (
char *)data);
123 text =
"=> Send header";
126 text =
"=> Send data";
129 text =
"=> Send SSL data";
132 text =
"<= Recv header";
135 text =
"<= Recv data";
138 text =
"<= Recv SSL data";
int libtest_debug_cb(CURL *handle, curl_infotype type, unsigned char *data, size_t size, void *userp)
UNITTEST_START char * ptr
static time_t epoch_offset
static void libtest_debug_dump(const char *timebuf, const char *text, FILE *stream, const unsigned char *ptr, size_t size, int nohex)
struct libtest_trace_cfg libtest_debug_config
struct timeval tutil_tvnow(void)