diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/http.c | 8 | ||||
-rw-r--r-- | lib/transfer.c | 3 | ||||
-rw-r--r-- | lib/urldata.h | 5 |
3 files changed, 13 insertions, 3 deletions
diff --git a/lib/http.c b/lib/http.c index 3c2eceff3..32666d82b 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1116,10 +1116,12 @@ CURLcode Curl_http_done(struct connectdata *conn) conn->bytecount = http->readbytecount + http->writebytecount; if(!conn->bits.retry && - !(http->readbytecount + conn->headerbytecount)) { + ((http->readbytecount + + conn->headerbytecount - + conn->deductheadercount)) <= 0) { /* If this connection isn't simply closed to be retried, AND nothing was - read from the HTTP server, this can't be right so we return an error - here */ + read from the HTTP server (that counts), this can't be right so we + return an error here */ failf(data, "Empty reply from server"); return CURLE_GOT_NOTHING; } diff --git a/lib/transfer.c b/lib/transfer.c index 4d5577a05..4385b843d 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -468,6 +468,9 @@ CURLcode Curl_readwrite(struct connectdata *conn, data->info.header_size += headerlen; conn->headerbytecount += headerlen; + conn->deductheadercount = + (100 == k->httpcode)?conn->headerbytecount:0; + if (conn->resume_from && !k->content_range && (data->set.httpreq==HTTPREQ_GET)) { diff --git a/lib/urldata.h b/lib/urldata.h index 4ed66243d..4f53d8412 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -438,6 +438,11 @@ struct connectdata { char *ppath; curl_off_t bytecount; long headerbytecount; /* only count received headers */ + long deductheadercount; /* this amount of bytes doesn't count when we check + if anything has been transfered at the end of + a connection. We use this counter to make only + a 100 reply (without a following second response + code) result in a CURLE_GOT_NOTHING error code */ char *range; /* range, if used. See README for detailed specification on this syntax. */ |