Loading CHANGES +3 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,9 @@ Changelog Daniel Fandrich (11 Jul 2008) - Fixed test 553 to pass the torture test. Daniel Stenberg (11 Jul 2008) - Daniel Fandrich found out we didn't pass on the user-agent properly when doing "proxy-tunnels" with non-HTTP prototols and that was simply because Loading tests/libtest/lib552.c +4 −3 Original line number Diff line number Diff line Loading @@ -146,10 +146,10 @@ static curlioerr ioctl_callback(CURL * handle, int cmd, void *clientp) int test(char *URL) { CURL *curl; CURLcode res; CURLcode res = CURLE_OUT_OF_MEMORY; struct data config; size_t i; char fill[] = "test data"; static const char fill[] = "test data"; config.trace_ascii = 1; /* enable ascii tracing */ Loading Loading @@ -190,5 +190,6 @@ int test(char *URL) /* always cleanup */ curl_easy_cleanup(curl); } return 0; curl_global_cleanup(); return (int)res; } tests/libtest/lib553.c +31 −20 Original line number Diff line number Diff line Loading @@ -39,24 +39,31 @@ static size_t myreadfunc(void *ptr, size_t size, size_t nmemb, void *stream) #define SIZE_HEADERS 5000 static char buf[SIZE_HEADERS + 100]; int test(char *URL) { CURL *curl; CURLcode res; int i; struct curl_slist *headerlist=NULL; struct curl_slist *headerlist=NULL, *hl; curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if(curl) { for (i = 0; i < NUM_HEADERS; i++) { int len; len = sprintf(buf, "Header%d: ", i); int len = sprintf(buf, "Header%d: ", i); memset(&buf[len], 'A', SIZE_HEADERS); buf[len + SIZE_HEADERS]=0; /* zero terminate */ headerlist = curl_slist_append(headerlist, buf); hl = curl_slist_append(headerlist, buf); if (!hl) goto errout; headerlist = hl; } headerlist = curl_slist_append(headerlist, "Expect: "); hl = curl_slist_append(headerlist, "Expect: "); if (!hl) goto errout; headerlist = hl; curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); Loading @@ -66,9 +73,13 @@ int test(char *URL) curl_easy_setopt(curl, CURLOPT_HEADER, 1L); curl_easy_setopt(curl, CURLOPT_READFUNCTION, myreadfunc); res = curl_easy_perform(curl); errout: curl_easy_cleanup(curl); curl_slist_free_all(headerlist); } curl_global_cleanup(); return (int)res; } Loading
CHANGES +3 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,9 @@ Changelog Daniel Fandrich (11 Jul 2008) - Fixed test 553 to pass the torture test. Daniel Stenberg (11 Jul 2008) - Daniel Fandrich found out we didn't pass on the user-agent properly when doing "proxy-tunnels" with non-HTTP prototols and that was simply because Loading
tests/libtest/lib552.c +4 −3 Original line number Diff line number Diff line Loading @@ -146,10 +146,10 @@ static curlioerr ioctl_callback(CURL * handle, int cmd, void *clientp) int test(char *URL) { CURL *curl; CURLcode res; CURLcode res = CURLE_OUT_OF_MEMORY; struct data config; size_t i; char fill[] = "test data"; static const char fill[] = "test data"; config.trace_ascii = 1; /* enable ascii tracing */ Loading Loading @@ -190,5 +190,6 @@ int test(char *URL) /* always cleanup */ curl_easy_cleanup(curl); } return 0; curl_global_cleanup(); return (int)res; }
tests/libtest/lib553.c +31 −20 Original line number Diff line number Diff line Loading @@ -39,24 +39,31 @@ static size_t myreadfunc(void *ptr, size_t size, size_t nmemb, void *stream) #define SIZE_HEADERS 5000 static char buf[SIZE_HEADERS + 100]; int test(char *URL) { CURL *curl; CURLcode res; int i; struct curl_slist *headerlist=NULL; struct curl_slist *headerlist=NULL, *hl; curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if(curl) { for (i = 0; i < NUM_HEADERS; i++) { int len; len = sprintf(buf, "Header%d: ", i); int len = sprintf(buf, "Header%d: ", i); memset(&buf[len], 'A', SIZE_HEADERS); buf[len + SIZE_HEADERS]=0; /* zero terminate */ headerlist = curl_slist_append(headerlist, buf); hl = curl_slist_append(headerlist, buf); if (!hl) goto errout; headerlist = hl; } headerlist = curl_slist_append(headerlist, "Expect: "); hl = curl_slist_append(headerlist, "Expect: "); if (!hl) goto errout; headerlist = hl; curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); Loading @@ -66,9 +73,13 @@ int test(char *URL) curl_easy_setopt(curl, CURLOPT_HEADER, 1L); curl_easy_setopt(curl, CURLOPT_READFUNCTION, myreadfunc); res = curl_easy_perform(curl); errout: curl_easy_cleanup(curl); curl_slist_free_all(headerlist); } curl_global_cleanup(); return (int)res; }