summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2005-05-20 11:06:59 +0000
committerDamien Miller <djm@cvs.openbsd.org>2005-05-20 11:06:59 +0000
commit8fa1db0817ccdff7f69ad2fe2fcfd904f29ec6c1 (patch)
tree6e25f1b904e0c80d3f6796ac4656cd29ddf88b6a
parent7d5f47980083845858c98a63fb42d548f2ed9558 (diff)
HTTP proxy doesn't need an address lookup - saves some time and avoids a
spurious error if the lookup fails. from Ray; ok markus@
-rw-r--r--usr.bin/nc/socks.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/nc/socks.c b/usr.bin/nc/socks.c
index c665ea731a8..ca67c6df593 100644
--- a/usr.bin/nc/socks.c
+++ b/usr.bin/nc/socks.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: socks.c,v 1.12 2005/05/19 08:40:59 djm Exp $ */
+/* $OpenBSD: socks.c,v 1.13 2005/05/20 11:06:58 djm Exp $ */
/*
* Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
@@ -129,7 +129,9 @@ socks_connect(const char *host, const char *port,
if (proxyfd < 0)
return (-1);
- serveraddr = decode_addr(host);
+ /* HTTP proxies should use hostnames. (XXX so can SOCKS5) */
+ if (socksv != -1)
+ serveraddr = decode_addr(host);
serverport = decode_port(port);
if (socksv == 5) {