From 24b37ca6c6a1ec2e1b5ef4e0dd421024e80d5800 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Sat, 19 Jan 2008 04:05:39 +0000 Subject: [PATCH] Improved verbose output, easier for the eyes git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@175 bc163920-b10d-0410-b2c5-a5491ca2ceef --- CHANGES | 1 + http.c | 12 ++++++------ io.c | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 466c5c8..6dafe9c 100755 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,7 @@ Changes to proxytunnel version 1.8.0svn -- Sat Jan 19 04:42:11 CET 2008 - Disable output by default on Windows build (Dag Wieers) - Headers now have a trailing \r\n (Dag Wieers) - Updated SPEC file to RPMforge standards (Dag Wieers) +- Improved verbose output, easier for the eyes (Dag Wieers) Changes to proxytunnel version 1.8.0 -- Mon Dec 31 16:46:52 CET 2007 diff --git a/http.c b/http.c index 8e44982..2db93b9 100644 --- a/http.c +++ b/http.c @@ -102,7 +102,7 @@ void print_line_prefix(char *buf, char *prefix) buf = strdup(buf); char *cur = strtok(buf, "\r\n"); while ( cur != NULL) { - message( "%s %s\n", prefix, cur ); + message( "%s%s\n", prefix, cur ); cur = strtok(NULL, "\r\n"); } } @@ -136,13 +136,13 @@ void proxy_protocol(PTSTREAM *pts) if (args_info.remproxy_given ) { if( args_info.verbose_flag ) - message( "Tunneling to %s (remote proxy)\n", args_info.remproxy_arg ); + message( "\nTunneling to %s (remote proxy)\n", args_info.remproxy_arg ); sprintf( buf, "CONNECT %s HTTP/1.0\r\n", args_info.remproxy_arg ); } else { if( args_info.verbose_flag ) - message( "Tunneling to %s (destination)\n", args_info.dest_arg ); + message( "\nTunneling to %s (destination)\n", args_info.dest_arg ); sprintf( buf, "CONNECT %s HTTP/1.0\r\n", args_info.dest_arg ); } @@ -178,7 +178,7 @@ void proxy_protocol(PTSTREAM *pts) */ if( args_info.verbose_flag ) { message( "Connect string sent to local proxy:\n"); - print_line_prefix(buf, "->"); + print_line_prefix(buf, " đ» "); } /* @@ -205,7 +205,7 @@ void proxy_protocol(PTSTREAM *pts) while ( strcmp( buf, "\r\n" ) != 0 ) readline(pts); if( args_info.verbose_flag ) - message( "Tunneling to %s (destination)\n", args_info.dest_arg ); + message( "\nTunneling to %s (destination)\n", args_info.dest_arg ); sprintf( buf, "CONNECT %s HTTP/1.0\r\n", args_info.dest_arg); /* @@ -220,7 +220,7 @@ void proxy_protocol(PTSTREAM *pts) */ if( args_info.verbose_flag ) { message( "Connect string sent to remote proxy:\n"); - print_line_prefix(buf, "->"); + print_line_prefix(buf, " » "); } /* diff --git a/io.c b/io.c index accc7ce..b68334c 100644 --- a/io.c +++ b/io.c @@ -65,7 +65,7 @@ int readline(PTSTREAM *pts) char * dstr = malloc(sizeof(buf) + 1); strlcpy( dstr, buf, strlen(buf) - 1); if (strcmp(dstr, "")) - message( "<- %s\n", dstr ); + message( " « %s\n", dstr ); } return strlen( buf ); } @@ -97,7 +97,7 @@ void cpio(PTSTREAM *stream1, PTSTREAM *stream2) FD_ZERO( &writefds ); if( args_info.verbose_flag ) - message( "Tunnel established\n" ); + message( "\nTunnel established.\n" ); /* * Only diamonds are forever :-)