diff options
author | Steve Holme <steve_holme@hotmail.com> | 2013-12-27 10:55:01 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-12-27 10:58:31 +0000 |
commit | f2d234a4dd9bcc5760d92697546fea14b5897a0e (patch) | |
tree | 3bc3e72f6a35fa2e26a75feb95bc95cde4cded54 /lib/sendf.c | |
parent | 2a4ee0d221555686b4a8eae87e54a19e128f7271 (diff) | |
download | curl-f2d234a4dd9bcc5760d92697546fea14b5897a0e.tar.gz |
FILE: Fixed sending of data would always return CURLE_WRITE_ERROR
Introduced in commit 2a4ee0d2215556 sending of data via the FILE
protocol would always return CURLE_WRITE_ERROR regardless of whether
CURL_WRITEFUNC_PAUSE was returned from the callback function or not.
Diffstat (limited to 'lib/sendf.c')
-rw-r--r-- | lib/sendf.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/sendf.c b/lib/sendf.c index 8ffd43f47..d508dfd3e 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -444,17 +444,17 @@ CURLcode Curl_client_write(struct connectdata *conn, wrote = len; } - if(conn->handler->flags & PROTOPT_NONETWORK) { - /* protocols that work without network cannot be paused. This is - actually only FILE:// just now, and it can't pause since the transfer - isn't done using the "normal" procedure. */ - failf(data, "Write callback asked for PAUSE when not supported!"); - return CURLE_WRITE_ERROR; + if(CURL_WRITEFUNC_PAUSE == wrote) { + if(conn->handler->flags & PROTOPT_NONETWORK) { + /* protocols that work without network cannot be paused. This is + actually only FILE:// just now, and it can't pause since the transfer + isn't done using the "normal" procedure. */ + failf(data, "Write callback asked for PAUSE when not supported!"); + return CURLE_WRITE_ERROR; + } + else + return pausewrite(data, type, ptr, len); } - - else if(CURL_WRITEFUNC_PAUSE == wrote) - return pausewrite(data, type, ptr, len); - else if(wrote != len) { failf(data, "Failed writing body (%zu != %zu)", wrote, len); return CURLE_WRITE_ERROR; |