large headers: have curl accept >16K headers

As commit 5850cc4808 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.
This commit is contained in:
Daniel Stenberg 2011-10-24 17:28:41 +02:00
parent 5850cc4808
commit 515f11e79b
4 changed files with 63 additions and 6 deletions

View File

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

View File

@ -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;
}
}
{

View File

@ -74,7 +74,7 @@ test1102 test1103 test1104 test1105 test1106 test1107 test1108 test1109 \
test1110 test1111 test1112 test1113 test1114 test1115 test1116 test1117 \
test1118 test1119 test1120 test1121 test1122 test1123 test1124 test1125 \
test1126 test1127 test1128 test1129 test1130 test1131 \
test1200 test1201 test1202 test1203 test1204 \
test1200 test1201 test1202 test1203 test1204 test1205 \
test1300 test1301 test1302 test1303 test1304 test1305 \
test1306 test1307 test1308 test1309 test1310 test1311 test1312 test1313 \
test1314 \

50
tests/data/test1205 Normal file

File diff suppressed because one or more lines are too long