diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-04-27 08:02:10 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-04-27 08:02:10 +0000 |
commit | 3974f30ed466c1ec8430061574f9c3530982660d (patch) | |
tree | 9ed120cc39f2c54bc56089e451248ae9ae0f5f94 /lib/transfer.c | |
parent | 44c246dbf2104258551f339eade5d8101d120a7d (diff) |
improved treatment of "Content-Length: 0", which is done by having
maxdownload set to -1 when not used
Diffstat (limited to 'lib/transfer.c')
-rw-r--r-- | lib/transfer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 52fde048f..805484bba 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -622,7 +622,7 @@ Transfer(struct connectdata *c_conn) /* If it returned OK, we just keep going */ } - if(conn->maxdownload && + if((-1 != conn->maxdownload) && (bytecount + nread >= conn->maxdownload)) { nread = conn->maxdownload - bytecount; if((signed int)nread < 0 ) /* this should be unusual */ @@ -634,7 +634,7 @@ Transfer(struct connectdata *c_conn) Curl_pgrsSetDownloadCounter(data, (double)bytecount); - if(! conn->bits.chunk) { + if(!conn->bits.chunk && nread) { /* If this is chunky transfer, it was already written */ urg = Curl_client_write(data, CLIENTWRITE_BODY, str, nread); if(urg) |