summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2013-09-09 13:10:53 +0200
committerKamil Dudka <kdudka@redhat.com>2013-09-09 13:23:04 +0200
commitc639d725a37c91fb49bb3a689cb2596fad3a0645 (patch)
tree04386f0f88f6cf5a044f5090423be9b900f82436 /lib
parent857f999353f333d458f4ebb7de48fed864a4badb (diff)
downloadcurl-c639d725a37c91fb49bb3a689cb2596fad3a0645.tar.gz
url: handle abortion by read/write callbacks, too
Otherwise, the FTP protocol would unnecessarily hang 60 seconds if aborted in the CURLOPT_HEADERFUNCTION callback. Reported by: Tomas Mlcoch Bug: https://bugzilla.redhat.com/1005686
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/url.c b/lib/url.c
index f6da3ca26..50ce80df4 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -5743,12 +5743,18 @@ CURLcode Curl_done(struct connectdata **connp,
conn->dns_entry = NULL;
}
- if(status == CURLE_ABORTED_BY_CALLBACK)
+ switch(status) {
+ case CURLE_ABORTED_BY_CALLBACK:
+ case CURLE_READ_ERROR:
+ case CURLE_WRITE_ERROR:
/* When we're aborted due to a callback return code it basically have to
be counted as premature as there is trouble ahead if we don't. We have
many callbacks and protocols work differently, we could potentially do
this more fine-grained in the future. */
premature = TRUE;
+ default:
+ break;
+ }
/* this calls the protocol-specific function pointer previously set */
if(conn->handler->done)