From 3f6133be2735936631c4bfe5aedd28ae9b084f3f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 12 Apr 2002 07:21:11 +0000 Subject: Jean-Philippe Barrette-LaPierre provided his patch that introduces CURLOPT_DEBUGFUNCTION and CURLOPT_DEBUGDATA. --- lib/http.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'lib/http.c') diff --git a/lib/http.c b/lib/http.c index 9e0275f70..42c167275 100644 --- a/lib/http.c +++ b/lib/http.c @@ -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 */ -- cgit v1.2.3