mirror of
https://github.com/curl/curl.git
synced 2026-04-15 02:21:41 +03:00
parent
96a5ce5a82
commit
ebead15f4e
1 changed files with 18 additions and 21 deletions
|
|
@ -25,11 +25,24 @@
|
|||
|
||||
#include "memdebug.h"
|
||||
|
||||
size_t WriteOutput(char *ptr, size_t size, size_t nmemb, void *stream);
|
||||
size_t WriteHeader(char *ptr, size_t size, size_t nmemb, void *stream);
|
||||
|
||||
static size_t realHeaderSize = 0;
|
||||
|
||||
static size_t WriteOutput(char *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
fwrite(ptr, size, nmemb, stream);
|
||||
return nmemb * size;
|
||||
}
|
||||
|
||||
static size_t WriteHeader(char *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
(void)ptr;
|
||||
(void)stream;
|
||||
|
||||
realHeaderSize += size * nmemb;
|
||||
|
||||
return nmemb * size;
|
||||
}
|
||||
|
||||
static CURLcode test_lib1509(const char *URL)
|
||||
{
|
||||
long headerSize;
|
||||
|
|
@ -43,8 +56,8 @@ static CURLcode test_lib1509(const char *URL)
|
|||
|
||||
easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); /* set in first.c */
|
||||
|
||||
easy_setopt(curl, CURLOPT_WRITEFUNCTION, *WriteOutput);
|
||||
easy_setopt(curl, CURLOPT_HEADERFUNCTION, *WriteHeader);
|
||||
easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteOutput);
|
||||
easy_setopt(curl, CURLOPT_HEADERFUNCTION, WriteHeader);
|
||||
|
||||
easy_setopt(curl, CURLOPT_HEADER, 1L);
|
||||
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
|
@ -79,19 +92,3 @@ test_cleanup:
|
|||
|
||||
return res;
|
||||
}
|
||||
|
||||
size_t WriteOutput(char *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
fwrite(ptr, size, nmemb, stream);
|
||||
return nmemb * size;
|
||||
}
|
||||
|
||||
size_t WriteHeader(char *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
(void)ptr;
|
||||
(void)stream;
|
||||
|
||||
realHeaderSize += size * nmemb;
|
||||
|
||||
return nmemb * size;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue