--------------------- PatchSet 5233 Date: 2007/08/10 09:32:39 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Make squidclient use destination squid address type determin the connection to be used. Members: tools/squidclient.cc:1.5.4.5->1.5.4.6 Index: squid3/tools/squidclient.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/tools/squidclient.cc,v retrieving revision 1.5.4.5 retrieving revision 1.5.4.6 diff -u -r1.5.4.5 -r1.5.4.6 --- squid3/tools/squidclient.cc 10 Aug 2007 07:54:03 -0000 1.5.4.5 +++ squid3/tools/squidclient.cc 10 Aug 2007 09:32:39 -0000 1.5.4.6 @@ -1,6 +1,6 @@ /* - * $Id: squidclient.cc,v 1.5.4.5 2007/08/10 07:54:03 amosjeffries Exp $ + * $Id: squidclient.cc,v 1.5.4.6 2007/08/10 09:32:39 amosjeffries Exp $ * * DEBUG: section 0 WWW Client * AUTHOR: Harvest Derived @@ -463,6 +463,14 @@ exit(1); } } + else { + /* Process the remote host name to locate the Protocol required + in case we are being asked to link to another version of squid */ + if( !iaddr.GetHostByName(hostname) ) { + fprintf(stderr, "client: ERROR: Cannot resolve %s: Host unknown.\n", hostname); + exit(1); + } + } iaddr.GetAddrInfo(AI); @@ -481,7 +489,10 @@ iaddr.SetEmpty(); - iaddr.GetHostByName(hostname); + if( !iaddr.GetHostByName(hostname) ) { + fprintf(stderr, "client: ERROR: Cannot resolve %s: Host unknown.\n", hostname); + exit(1); + } iaddr.SetPort(port);