Host: header messes up httpd_accel mode

From: Jake Donham <jake@dont-contact.us>
Date: Fri, 22 Nov 1996 14:09:56 -0800

Hi,

I'm having a problem using httpd_accel mode with Squid 1.1 beta 20. Squid
uses the Host: header to decide the hostname to access, but the Host:
header includes the port number (if it's not 80), and you wind up with two
port numbers, like

 spazzy.vivid.com:3128:8000

(httpd is on 8000, Squid is on 3128, URL is spazzy.vivid.com:3128), and you
get a DNS lookup error.

The relevant code is in icp.c:

        } else if ((t = mime_get_header(req_hdr, "Host"))) {
            /* If a Host: header was specified, use it to build the URL
             * instead of the one in the Config file. */
            icpState->url = xcalloc(strlen(url) + strlen(t) + 32, 1);
            sprintf(icpState->url, "http://%s:%d%s",
                t, (int) Config.Accel.port, url);
        } else {

I can just comment that out but it seems like the Config.Accel.port should
override the Host port or something.

-----------
Jake Donham
Eating junk food and watching TV since 1972.
http://www.vivid.com/
Received on Fri Nov 22 1996 - 14:07:31 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:33:36 MST