Loading tests/libtest/lib517.c +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ #include "test.h" const char *dates[]={ static const char *dates[]={ "Sun, 06 Nov 1994 08:49:37 GMT", "Sunday, 06-Nov-94 08:49:37 GMT", "Sun Nov 6 08:49:37 1994", Loading tests/libtest/lib552.c +6 −6 Original line number Diff line number Diff line Loading @@ -106,15 +106,15 @@ int my_trace(CURL *handle, curl_infotype type, static size_t current_offset = 0; char data[70000]; /* MUST be more than 64k OR MAX_INITIAL_POST_SIZE */ static char databuf[70000]; /* MUST be more than 64k OR MAX_INITIAL_POST_SIZE */ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) { size_t amount = nmemb * size; /* Total bytes curl wants */ size_t available = sizeof data - current_offset; /* What we have to give */ size_t available = sizeof(databuf) - current_offset; /* What we have to give */ size_t given = amount < available ? amount : available; /* What is given */ (void)stream; memcpy(ptr, data + current_offset, given); memcpy(ptr, databuf + current_offset, given); current_offset += given; return given; } Loading Loading @@ -161,14 +161,14 @@ int test(char *URL) curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* setup repeated data string */ for (i=0; i < sizeof data; ++i) data[i] = fill[i % sizeof fill]; for (i=0; i < sizeof(databuf); ++i) databuf[i] = fill[i % sizeof fill]; /* Post */ curl_easy_setopt(curl, CURLOPT_POST, 1L); /* Setup read callback */ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof data); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof(databuf)); curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); /* Write callback */ Loading Loading
tests/libtest/lib517.c +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ #include "test.h" const char *dates[]={ static const char *dates[]={ "Sun, 06 Nov 1994 08:49:37 GMT", "Sunday, 06-Nov-94 08:49:37 GMT", "Sun Nov 6 08:49:37 1994", Loading
tests/libtest/lib552.c +6 −6 Original line number Diff line number Diff line Loading @@ -106,15 +106,15 @@ int my_trace(CURL *handle, curl_infotype type, static size_t current_offset = 0; char data[70000]; /* MUST be more than 64k OR MAX_INITIAL_POST_SIZE */ static char databuf[70000]; /* MUST be more than 64k OR MAX_INITIAL_POST_SIZE */ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) { size_t amount = nmemb * size; /* Total bytes curl wants */ size_t available = sizeof data - current_offset; /* What we have to give */ size_t available = sizeof(databuf) - current_offset; /* What we have to give */ size_t given = amount < available ? amount : available; /* What is given */ (void)stream; memcpy(ptr, data + current_offset, given); memcpy(ptr, databuf + current_offset, given); current_offset += given; return given; } Loading Loading @@ -161,14 +161,14 @@ int test(char *URL) curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* setup repeated data string */ for (i=0; i < sizeof data; ++i) data[i] = fill[i % sizeof fill]; for (i=0; i < sizeof(databuf); ++i) databuf[i] = fill[i % sizeof fill]; /* Post */ curl_easy_setopt(curl, CURLOPT_POST, 1L); /* Setup read callback */ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof data); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof(databuf)); curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); /* Write callback */ Loading