Jean-Philippe Barrette-LaPierre provided his patch that introduces

CURLOPT_DEBUGFUNCTION and CURLOPT_DEBUGDATA.
This commit is contained in:
Daniel Stenberg 2002-04-12 07:21:11 +00:00
parent c3bfb355c5
commit 3f6133be27
7 changed files with 92 additions and 30 deletions

View file

@ -133,12 +133,6 @@ CURLcode add_buffer_send(int sockfd, struct connectdata *conn, send_buffer *in,
char *ptr;
int size;
if(conn->data->set.verbose) {
fputs("> ", conn->data->set.err);
/* this data _may_ contain binary stuff */
fwrite(in->buffer, in->size_used, 1, conn->data->set.err);
}
/* The looping below is required since we use non-blocking sockets, but due
to the circumstances we will just loop and try again and again etc */
@ -150,6 +144,10 @@ CURLcode add_buffer_send(int sockfd, struct connectdata *conn, send_buffer *in,
if(CURLE_OK != res)
break;
if(conn->data->set.verbose)
/* this data _may_ contain binary stuff */
Curl_debug(conn->data, CURLINFO_DATA_OUT, ptr, amount);
if(amount != size) {
size -= amount;
ptr += amount;
@ -364,11 +362,8 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
the line isn't really terminated until the LF comes */
/* output debug output if that is requested */
if(data->set.verbose) {
fputs("< ", data->set.err);
fwrite(line_start, perline, 1, data->set.err);
/* no need to output LF here, it is part of the data */
}
if(data->set.verbose)
Curl_debug(data, CURLINFO_DATA_IN, line_start, perline);
if('\r' == line_start[0]) {
/* end of headers */