diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-04-07 14:27:54 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-04-07 14:27:54 +0000 |
commit | 72b1144b8c1844ec81d5f5b73eb9b2a088377fec (patch) | |
tree | dea9c5bb99974d03b21c53b51266798d7cca6fe8 /lib | |
parent | 348fe0e210f7e593c80e956d0270c220705f132a (diff) |
getting only a 100 Continue response and nothing else, when talking HTTP,
is now treated as an error by libcurl
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. */ |