]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
squidclient: Display IP(s) connected to in verbose display.
authorAmos Jeffries <amosjeffries@squid-cache.org>
Thu, 23 Sep 2010 14:11:09 +0000 (08:11 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Thu, 23 Sep 2010 14:11:09 +0000 (08:11 -0600)
tools/squidclient.cc

index 5ca0f449b3e2a23aca3deab9e14d5306a26f679d..4eea9e0bc32985c3a965ca7a6d9e388ec7ccd582 100644 (file)
@@ -511,7 +511,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
@@ -539,6 +539,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) {
@@ -576,6 +579,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);
@@ -588,6 +596,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));