From bd3166176fdb7ed96211eb539316f47843e0faa7 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 2 Dec 2011 10:32:54 +0000 Subject: Somewhat improve debug logging of HTTP/SOAP stuff. --- lib/http_client.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/http_client.c') diff --git a/lib/http_client.c b/lib/http_client.c index 8bd543af..56a6f376 100644 --- a/lib/http_client.c +++ b/lib/http_client.c @@ -278,6 +278,9 @@ got_reply: *end1 = 0; + if( getenv( "BITLBEE_DEBUG" ) ) + printf( "HTTP response headers:\n%s", req->reply_headers ); + if( evil_server ) req->reply_body = end1 + 1; else @@ -414,6 +417,9 @@ got_reply: req->fd = -1; req->ssl = NULL; + if( getenv( "BITLBEE_DEBUG" ) ) + printf( "New headers for redirected HTTP request:\n%s", new_request ); + if( new_proto == PROTO_HTTPS ) { req->ssl = ssl_connect( new_host, new_port, http_ssl_connected, req ); @@ -455,6 +461,10 @@ cleanup: else closesocket( req->fd ); + if( getenv( "BITLBEE_DEBUG" ) && req ) + printf( "Finishing HTTP request with status: %s", + req->status_string ? req->status_string : "NULL" ); + req->func( req ); http_free( req ); return FALSE; -- cgit v1.2.3