36 void dump(
const char *text,
37 FILE *stream,
unsigned char *
ptr,
size_t size,
43 unsigned int width = 0x10;
49 fprintf(stream,
"%s, %d bytes (0x%x)\n", text, (
int)size, (
int)size);
53 fprintf(stream,
"%04x: ", (
int)i);
57 for(c = 0; c <
width; c++)
59 fprintf(stream,
"%02x ", ptr[i + c]);
64 for(c = 0; (c <
width) && (i + c < size); c++) {
66 if(nohex && (i + c + 1 < size) && ptr[i + c] == 0x0D &&
67 ptr[i + c + 1] == 0x0A) {
72 (ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)? ptr[i + c] :
'.');
74 if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
75 ptr[i + c + 2] == 0x0A) {
90 struct data *
config = (
struct data *)userp;
96 fprintf(stderr,
"== Info: %s", (
char *)data);
102 text =
"=> Send header";
105 text =
"=> Send data";
108 text =
"=> Send SSL data";
111 text =
"<= Recv header";
114 text =
"<= Recv data";
117 text =
"<= Recv SSL data";
132 size_t amount = nmemb *
size;
135 size_t given = amount < available ? amount : available;
147 printf(
"%.*s", amount, (
char *)ptr);
157 printf(
"APPLICATION: received a CURLIOCMD_RESTARTREAD request\n");
158 printf(
"APPLICATION: ** REWINDING! **\n");
174 static const char fill[] =
"test data";
187 for(i = 0; i <
sizeof(
databuf); ++
i)
188 databuf[i] = fill[i %
sizeof fill];
193 #ifdef CURL_DOES_CONVERSIONS 217 fprintf(stderr,
"curl_easy_perform = %d\n", (
int)res);
static char databuf[70000]
#define test_setopt(A, B, C)
static void dump(const char *text, FILE *stream, unsigned char *ptr, size_t size, char nohex)
UNITTEST_START char * ptr
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
int curlx_uztosi(size_t uznum)
static size_t current_offset
static int my_trace(CURL *handle, curl_infotype type, char *data, size_t size, void *userp)
memcpy(filename, filename1, strlen(filename1))
CURL_EXTERN void curl_easy_cleanup(CURL *curl)
static size_t write_callback(void *ptr, size_t size, size_t nmemb, void *stream)
static curlioerr ioctl_callback(CURL *handle, int cmd, void *clientp)
CURL_EXTERN void curl_global_cleanup(void)
curl_global_cleanup() globally cleanups curl, uses the value of "init_flags" to determine what needs ...
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl)