aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-01-29 12:52:45 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-01-29 12:52:45 +0000
commit30a46e1135f4d2cfc8d322a0ec3bf9557d93f124 (patch)
tree4b71eb0fc9526ede374d0b1c06fffe8602620a20
parent3a01478ce818e00fdc3b831420b7c8a815c0af2a (diff)
John McGowan found a problem where the DEBUGFUNCTION was called with bad
data on uploads.
-rw-r--r--lib/transfer.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 413eaeba2..e8cad9e3f 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1007,7 +1007,13 @@ CURLcode Curl_readwrite(struct connectdata *conn,
&bytes_written); /* actually send away */
if(result)
return result;
- else if(conn->upload_present != bytes_written) {
+
+ if(data->set.verbose)
+ /* show the data before we change the pointer upload_fromhere */
+ Curl_debug(data, CURLINFO_DATA_OUT, conn->upload_fromhere,
+ bytes_written);
+
+ if(conn->upload_present != bytes_written) {
/* we only wrote a part of the buffer (if anything), deal with it! */
/* store the amount of bytes left in the buffer to write */
@@ -1032,11 +1038,6 @@ CURLcode Curl_readwrite(struct connectdata *conn,
}
}
- if(data->set.verbose)
- Curl_debug(data, CURLINFO_DATA_OUT, conn->upload_fromhere,
- bytes_written);
-
-
k->writebytecount += bytes_written;
Curl_pgrsSetUploadCounter(data, (double)k->writebytecount);