aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2008-11-13 08:20:23 +0000
committerMichal Marek <mmarek@suse.cz>2008-11-13 08:20:23 +0000
commitc331c73ec6d16aa2c40eb7e9e0f2426c7170c47d (patch)
tree22b3bf9aed350a0a7ab9a5761775c3be77b457ec /lib
parentd1f063c62de80d755b7b59968c356f8c5fcb0017 (diff)
- Fixed a potential data loss in Curl_client_write() when the transfer is
paused.
Diffstat (limited to 'lib')
-rw-r--r--lib/sendf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sendf.c b/lib/sendf.c
index 4fe0b4806..566e26aa6 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -425,7 +425,7 @@ static CURLcode pausewrite(struct SessionHandle *data,
}
-/* client_write() sends data to the write callback(s)
+/* Curl_client_write() sends data to the write callback(s)
The bit pattern defines to what "streams" to write to. Body and/or header.
The defines are in sendf.h of course.
@@ -442,6 +442,9 @@ CURLcode Curl_client_write(struct connectdata *conn,
struct SessionHandle *data = conn->data;
size_t wrote;
+ if(0 == len)
+ len = strlen(ptr);
+
/* If reading is actually paused, we're forced to append this chunk of data
to the already held data, but only if it is the same type as otherwise it
can't work and it'll return error instead. */
@@ -469,9 +472,6 @@ CURLcode Curl_client_write(struct connectdata *conn,
return CURLE_OK;
}
- if(0 == len)
- len = strlen(ptr);
-
if(type & CLIENTWRITE_BODY) {
if((conn->protocol&PROT_FTP) && conn->proto.ftpc.transfertype == 'A') {
#ifdef CURL_DOES_CONVERSIONS