From 7df6fe2919a66c44576f54905d71e5314dc73d25 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 20 Oct 2010 00:07:56 -0600 Subject: [PATCH] squidclient: Display IP(s) connected to in verbose display. --- tools/squidclient.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/squidclient.cc b/tools/squidclient.cc index 200891516d..a7c7b59be6 100644 --- a/tools/squidclient.cc +++ b/tools/squidclient.cc @@ -447,7 +447,7 @@ main(int argc, char *argv[]) } if (opt_verbose) - fprintf(stderr, "Request: '%s'\n", msg); + fprintf(stderr, "Request:'%s'\n", msg); if (ping) { #if HAVE_SIGACTION @@ -475,6 +475,9 @@ main(int argc, char *argv[]) int fsize = 0; struct addrinfo *AI = NULL; + if (opt_verbose) + fprintf(stderr, "Resolving... %s\n", hostname); + /* Connect to the server */ if (localhost) { @@ -512,6 +515,11 @@ main(int argc, char *argv[]) iaddr.SetPort(port); + if (opt_verbose) { + char ipbuf[MAX_IPSTRLEN]; + fprintf(stderr, "Connecting... %s(%s)\n", hostname, iaddr.NtoA(ipbuf, MAX_IPSTRLEN)); + } + if (client_comm_connect(conn, iaddr, ping ? &tv1 : NULL) < 0) { char hostnameBuf[MAX_IPSTRLEN]; iaddr.ToURL(hostnameBuf, MAX_IPSTRLEN); @@ -524,6 +532,10 @@ main(int argc, char *argv[]) } exit(1); } + if (opt_verbose) { + char ipbuf[MAX_IPSTRLEN]; + fprintf(stderr, "Connected to: %s (%s)\n", hostname, iaddr.NtoA(ipbuf, MAX_IPSTRLEN)); + } /* Send the HTTP request */ bytesWritten = mywrite(conn, msg, strlen(msg)); -- 2.47.2