diff options
author | Daniel Stenberg <daniel@haxx.se> | 2011-10-24 17:28:41 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-10-24 17:28:41 +0200 |
commit | 515f11e79bf1d13a1659cb7d4cb03ba26a3bbae6 (patch) | |
tree | fd3eb84c9709b195a24a265a9df9faeb7be62eb5 /src/tool_cb_wrt.c | |
parent | 5850cc4808ab3669e7a973bd492a630f51804df3 (diff) | |
download | curl-515f11e79bf1d13a1659cb7d4cb03ba26a3bbae6.tar.gz |
large headers: have curl accept >16K headers
As commit 5850cc4808ab clarifies, libcurl can deliver header lines that
are longer than CURL_MAX_WRITE_SIZE, only body data is limited to that
size. The curl tool has check (when built debug-enabled) that made the
wrong checks and this new test 1205 verifies that larger headers work.
Diffstat (limited to 'src/tool_cb_wrt.c')
-rw-r--r-- | src/tool_cb_wrt.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c index de94f6e49..53c192084 100644 --- a/src/tool_cb_wrt.c +++ b/src/tool_cb_wrt.c @@ -55,9 +55,17 @@ size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata) return failure; #ifdef DEBUGBUILD - if(sz * nmemb > (size_t)CURL_MAX_WRITE_SIZE) { - warnf(config, "Data size exceeds single call write limit!\n"); - return failure; + if(config->include_headers) { + if(sz * nmemb > (size_t)CURL_MAX_HTTP_HEADER) { + warnf(config, "Data size exceeds single call write limit!\n"); + return failure; + } + } + else { + if(sz * nmemb > (size_t)CURL_MAX_WRITE_SIZE) { + warnf(config, "Data size exceeds single call write limit!\n"); + return failure; + } } { |