aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-12-21 10:15:38 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-12-21 10:15:38 +0000
commit89ab5f4380b9fd6507e0bc365310d88c82dd3de1 (patch)
tree21417e0df4f89a559011c30f4d88b2d56057a82e /lib/transfer.c
parent439b84c78222706c54a878cbc4238a2580a228b1 (diff)
Robson Braga Araujo reported bug #1618359
(http://curl.haxx.se/bug/view.cgi?id=1618359) and subsequently provided a patch for it: when downloading 2 zero byte files in a row, curl 7.16.0 enters an infinite loop, while curl 7.16.1-20061218 does one additional unnecessary request. Fix: During the "Major overhaul introducing http pipelining support and shared connection cache within the multi handle." change, headerbytecount was moved to live in the Curl_transfer_keeper structure. But that structure is reset in the Transfer method, losing the information that we had about the header size. This patch moves it back to the connectdata struct.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 4a37244f1..5aa1540c8 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -581,10 +581,10 @@ CURLcode Curl_readwrite(struct connectdata *conn,
return result;
data->info.header_size += (long)headerlen;
- k->headerbytecount += (long)headerlen;
+ conn->headerbytecount += (long)headerlen;
- k->deductheadercount =
- (100 == k->httpcode)?k->headerbytecount:0;
+ conn->deductheadercount =
+ (100 == k->httpcode)?conn->headerbytecount:0;
if (data->reqdata.resume_from &&
(data->set.httpreq==HTTPREQ_GET) &&
@@ -1040,7 +1040,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
return result;
data->info.header_size += (long)k->hbuflen;
- k->headerbytecount += (long)k->hbuflen;
+ conn->headerbytecount += (long)k->hbuflen;
/* reset hbufp pointer && hbuflen */
k->hbufp = data->state.headerbuff;
@@ -1564,7 +1564,6 @@ CURLcode Curl_readwrite_init(struct connectdata *conn)
k->writebytecountp = data->reqdata.writebytecountp;
k->bytecount = 0;
- k->headerbytecount = 0;
k->buf = data->state.buffer;
k->uploadbuf = data->state.uploadbuffer;
@@ -2247,7 +2246,7 @@ bool Curl_retry_request(struct connectdata *conn,
struct SessionHandle *data = conn->data;
struct Curl_transfer_keeper *k = &data->reqdata.keep;
- if((data->reqdata.keep.bytecount+k->headerbytecount == 0) &&
+ if((data->reqdata.keep.bytecount+conn->headerbytecount == 0) &&
conn->bits.reuse &&
!conn->bits.no_body) {
/* We got no data, we attempted to re-use a connection and yet we want a