$NetBSD: patch-ag,v 1.1 1999/05/01 09:55:32 tron Exp $ --- httpget.c Mon Nov 23 08:17:46 1998 +++ httpget.c Thu Apr 29 15:08:05 1999 @@ -154,6 +154,7 @@ if (!(proxyurl = getenv("http_proxy"))) proxyurl = getenv("HTTP_PROXY"); if (proxyurl && proxyurl[0] && strcmp(proxyurl, "none")) { + host = NULL; if (!(url2hostport(proxyurl, &host, &proxyip, &proxyport))) { fprintf (stderr, "Unknown proxy host \"%s\".\n", host ? host : ""); @@ -184,18 +185,22 @@ myip = proxyip; } else { + host = NULL; if (!(sptr = url2hostport(purl, &host, &myip, &myport))) { fprintf (stderr, "Unknown host \"%s\".\n", host ? host : ""); exit (1); } - if (host) - free (host); strcat (request, sptr); } sprintf (request + strlen(request), " HTTP/1.0\r\nUser-Agent: %s/%s\r\n", prgName, prgVersion); + if (host) { + sprintf(request + strlen(request), + "Host: %s:%u\r\n", host, myport); + free (host); + } strcat (request, ACCEPT_HEAD); strcat (request, "\r\n"); server.sin_family = AF_INET; >Audit-Trail: >Unformatted: