diff options
author | Colin Hogben <Colin.Hogben@ccfe.ac.uk> | 2014-01-13 15:00:38 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-01-13 16:54:10 +0100 |
commit | bbc1705fa916a92a724f2bfbf75b0ce2f970de9e (patch) | |
tree | 6ea40ea38b5d285827b9110c5367c4aff6e0829d | |
parent | 87ade5f0eb0d40c14ba65b04d309a4f52a49c1be (diff) |
error message: Sensible message on timeout when transfer size unknown
A transfer timeout could result in an error message such as "Operation
timed out after 3000 milliseconds with 19 bytes of -1 received". This
patch removes the non-sensical "of -1" when the size of the transfer
is unknown, mirroring the logic in lib/transfer.c
-rw-r--r-- | lib/multi.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/multi.c b/lib/multi.c index cab303049..dc7776cde 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -985,11 +985,19 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, Curl_tvdiff(now, data->progress.t_startsingle)); else { k = &data->req; - failf(data, "Operation timed out after %ld milliseconds with %" - CURL_FORMAT_CURL_OFF_T " out of %" - CURL_FORMAT_CURL_OFF_T " bytes received", - Curl_tvdiff(now, data->progress.t_startsingle), k->bytecount, - k->size); + if(k->size != -1) { + failf(data, "Operation timed out after %ld milliseconds with %" + CURL_FORMAT_CURL_OFF_T " out of %" + CURL_FORMAT_CURL_OFF_T " bytes received", + Curl_tvdiff(k->now, data->progress.t_startsingle), + k->bytecount, k->size); + } + else { + failf(data, "Operation timed out after %ld milliseconds with %" + CURL_FORMAT_CURL_OFF_T " bytes received", + Curl_tvdiff(now, data->progress.t_startsingle), + k->bytecount); + } } /* Force the connection closed because the server could continue to |