made the DEBUGFUNCTION get called properly on a few more places, especially
for DATA_IN and DATA_OUT.
This commit is contained in:
parent
39028f1bd4
commit
86cc34c0de
@ -294,6 +294,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
*****/
|
*****/
|
||||||
|
|
||||||
if (('\n' == *k->p) || ('\r' == *k->p)) {
|
if (('\n' == *k->p) || ('\r' == *k->p)) {
|
||||||
|
int headerlen;
|
||||||
/* Zero-length header line means end of headers! */
|
/* Zero-length header line means end of headers! */
|
||||||
|
|
||||||
if ('\r' == *k->p)
|
if ('\r' == *k->p)
|
||||||
@ -341,14 +342,16 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
if (data->set.http_include_header)
|
if (data->set.http_include_header)
|
||||||
k->writetype |= CLIENTWRITE_BODY;
|
k->writetype |= CLIENTWRITE_BODY;
|
||||||
|
|
||||||
|
headerlen = k->p - data->state.headerbuff;
|
||||||
|
|
||||||
result = Curl_client_write(data, k->writetype,
|
result = Curl_client_write(data, k->writetype,
|
||||||
data->state.headerbuff,
|
data->state.headerbuff,
|
||||||
k->p - data->state.headerbuff);
|
headerlen);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
data->info.header_size += k->p - data->state.headerbuff;
|
data->info.header_size += headerlen;
|
||||||
conn->headerbytecount += k->p - data->state.headerbuff;
|
conn->headerbytecount += headerlen;
|
||||||
|
|
||||||
if(!k->header) {
|
if(!k->header) {
|
||||||
/*
|
/*
|
||||||
@ -591,6 +594,10 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
if (data->set.http_include_header)
|
if (data->set.http_include_header)
|
||||||
k->writetype |= CLIENTWRITE_BODY;
|
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,
|
result = Curl_client_write(data, k->writetype, k->p,
|
||||||
k->hbuflen);
|
k->hbuflen);
|
||||||
if(result)
|
if(result)
|
||||||
@ -680,6 +687,10 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
} /* this is the first time we write a body part */
|
} /* this is the first time we write a body part */
|
||||||
k->bodywrites++;
|
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) {
|
if(conn->bits.chunk) {
|
||||||
/*
|
/*
|
||||||
* Bless me father for I have sinned. Here comes a chunked
|
* 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 */
|
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;
|
k->writebytecount += bytes_written;
|
||||||
Curl_pgrsSetUploadCounter(data, (double)k->writebytecount);
|
Curl_pgrsSetUploadCounter(data, (double)k->writebytecount);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user