curl tool: adjust header callback single call write limit warning

Maximum amount of data a header callback is supposed to get in
a single call from libcurl is limited by the lowest value of
CURL_MAX_WRITE_SIZE and CURL_MAX_HTTP_HEADER.
This commit is contained in:
Yang Tse 2011-09-28 19:03:36 +02:00
parent 9f2f8d5122
commit ff5ba6e43d
1 changed files with 2 additions and 1 deletions

View File

@ -57,7 +57,8 @@ size_t tool_header_cb(void *ptr, size_t size, size_t nmemb, void *userdata)
size_t failure = (size * nmemb) ? 0 : 1;
#ifdef DEBUGBUILD
if(size * nmemb > (size_t)CURL_MAX_WRITE_SIZE) {
if((size * nmemb > (size_t)CURL_MAX_WRITE_SIZE) ||
(size * nmemb > (size_t)CURL_MAX_HTTP_HEADER)) {
warnf(outs->config, "Header data exceeds single call write limit!\n");
return failure;
}