curl-users
Small patch for more convenient timeout message
Date: Tue, 25 Jul 2006 18:25:01 +0200
Hi,
i have made the following small patch that makes curl print out a more
convenient error message when a timeout happens.
Bye,
Georg
--- transfer.c.org 2006-07-25 17:29:06.000000000 +0200
+++ transfer.c 2006-07-25 17:32:59.000000000 +0200
@@ -1419,9 +1419,15 @@
if (data->set.timeout &&
((Curl_tvdiff(k->now, k->start)/1000) >= data->set.timeout)) {
- failf(data, "Operation timed out with %" FORMAT_OFF_T
- " out of %" FORMAT_OFF_T " bytes received",
- k->bytecount, conn->size);
+ if (conn->size != -1) {
+ failf(data, "Operation timed out after %d seconds with %"
+ FORMAT_OFF_T " out of %" FORMAT_OFF_T " bytes received",
+ data->set.timeout, k->bytecount, conn->size);
+ } else {
+ failf(data, "Operation timed out after %d seconds with %"
+ FORMAT_OFF_T " bytes received",
+ data->set.timeout, k->bytecount);
+ }
return CURLE_OPERATION_TIMEOUTED;
}
Received on 2006-07-25