diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-05-03 12:07:32 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-05-03 12:07:32 +0000 |
commit | 86cc34c0de18a159fcebde42d59f9d94a68bfac6 (patch) | |
tree | 458fe7dc667d2ce79ce401a42c55cc8ab46bfb33 /lib | |
parent | 39028f1bd49242468126aa7d93e498e1b40952b4 (diff) |
made the DEBUGFUNCTION get called properly on a few more places, especially
for DATA_IN and DATA_OUT.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/transfer.c | 22 |
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); |