aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/transfer.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 3e1004763..a861e95e7 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -294,6 +294,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
*****/
if (('\n' == *k->p) || ('\r' == *k->p)) {
+ int headerlen;
/* Zero-length header line means end of headers! */
if ('\r' == *k->p)
@@ -341,14 +342,16 @@ CURLcode Curl_readwrite(struct connectdata *conn,
if (data->set.http_include_header)
k->writetype |= CLIENTWRITE_BODY;
+ headerlen = k->p - data->state.headerbuff;
+
result = Curl_client_write(data, k->writetype,
data->state.headerbuff,
- k->p - data->state.headerbuff);
+ headerlen);
if(result)
return result;
- data->info.header_size += k->p - data->state.headerbuff;
- conn->headerbytecount += k->p - data->state.headerbuff;
+ data->info.header_size += headerlen;
+ conn->headerbytecount += headerlen;
if(!k->header) {
/*
@@ -591,6 +594,10 @@ CURLcode Curl_readwrite(struct connectdata *conn,
if (data->set.http_include_header)
k->writetype |= CLIENTWRITE_BODY;
+ if(data->set.verbose)
+ Curl_debug(data, CURLINFO_HEADER_IN,
+ k->p, k->hbuflen);
+
result = Curl_client_write(data, k->writetype, k->p,
k->hbuflen);
if(result)
@@ -680,6 +687,10 @@ CURLcode Curl_readwrite(struct connectdata *conn,
} /* this is the first time we write a body part */
k->bodywrites++;
+ /* pass data to the debug function before it gets "dechunked" */
+ if(data->set.verbose)
+ Curl_debug(data, CURLINFO_DATA_IN, k->str, nread);
+
if(conn->bits.chunk) {
/*
* Bless me father for I have sinned. Here comes a chunked
@@ -820,6 +831,11 @@ CURLcode Curl_readwrite(struct connectdata *conn,
conn->upload_present = 0; /* no more bytes left */
}
+ 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);