mirror of
https://github.com/moparisthebest/curl
synced 2025-03-11 07:39:50 -04:00
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
This commit is contained in:
parent
87ade5f0eb
commit
bbc1705fa9
18
lib/multi.c
18
lib/multi.c
@ -985,11 +985,19 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||||||
Curl_tvdiff(now, data->progress.t_startsingle));
|
Curl_tvdiff(now, data->progress.t_startsingle));
|
||||||
else {
|
else {
|
||||||
k = &data->req;
|
k = &data->req;
|
||||||
failf(data, "Operation timed out after %ld milliseconds with %"
|
if(k->size != -1) {
|
||||||
CURL_FORMAT_CURL_OFF_T " out of %"
|
failf(data, "Operation timed out after %ld milliseconds with %"
|
||||||
CURL_FORMAT_CURL_OFF_T " bytes received",
|
CURL_FORMAT_CURL_OFF_T " out of %"
|
||||||
Curl_tvdiff(now, data->progress.t_startsingle), k->bytecount,
|
CURL_FORMAT_CURL_OFF_T " bytes received",
|
||||||
k->size);
|
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
|
/* Force the connection closed because the server could continue to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user