diff options
author | Yang Tse <yangsita@gmail.com> | 2011-09-28 19:03:36 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2011-09-28 19:04:38 +0200 |
commit | ff5ba6e43d808b8cc7c8e099bb0329206031478f (patch) | |
tree | c868352d22a95e046ef390462cc3315e7071c1f2 | |
parent | 9f2f8d5122e1a88835bca132dab0d03fdec0da48 (diff) |
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.
-rw-r--r-- | src/tool_cb_hdr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c index ac3d6d216..15657867d 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; } |