From: Yang Tse Date: Wed, 28 Sep 2011 17:03:36 +0000 (+0200) Subject: curl tool: adjust header callback single call write limit warning X-Git-Tag: curl-7_23_0~131 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ff5ba6e43d808b8cc7c8e099bb0329206031478f;p=thirdparty%2Fcurl.git 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. --- diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c index ac3d6d216b..15657867dc 100644 --- a/src/tool_cb_hdr.c +++ b/src/tool_cb_hdr.c @@ -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; }