made the DEBUGFUNCTION get called properly on a few more places, especially

for DATA_IN and DATA_OUT.
This commit is contained in:
Daniel Stenberg 2002-05-03 12:07:32 +00:00
parent 39028f1bd4
commit 86cc34c0de

View File

@ -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);