*** squid-1.1.20/src/icp.c.orig Thu Dec 18 05:58:54 1997 --- squid-1.1.20/src/icp.c Thu Jan 29 23:08:51 1998 *************** *** 1682,1698 **** *t = '\0'; /* see if we running in httpd_accel_mode, if so got to convert it to URL */ if (httpd_accel_mode && *url == '/') { ! /* prepend the accel prefix */ ! if (vhost_mode) { ! /* Put the local socket IP address as the hostname */ ! url_sz = strlen(url) + 32 + Config.appendDomainLen; ! icpState->url = xcalloc(url_sz, 1); ! sprintf(icpState->url, "http://%s:%d%s", ! inet_ntoa(icpState->me.sin_addr), ! (int) Config.Accel.port, ! url); ! debug(12, 5, "VHOST REWRITE: '%s'\n", icpState->url); ! } else if (opt_accel_uses_host && (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. */ /* --- 1682,1689 ---- *t = '\0'; /* see if we running in httpd_accel_mode, if so got to convert it to URL */ if (httpd_accel_mode && *url == '/') { ! /* prepend the accel prefix */ ! if (opt_accel_uses_host && (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. */ /* *************** *** 1707,1712 **** --- 1698,1712 ---- icpState->url = xcalloc(url_sz, 1); sprintf(icpState->url, "http://%s:%d%s", t, (int) Config.Accel.port, url); + } else if (vhost_mode) { + /* Put the local socket IP address as the hostname */ + url_sz = strlen(url) + 32 + Config.appendDomainLen; + icpState->url = xcalloc(url_sz, 1); + sprintf(icpState->url, "http://%s:%d%s", + inet_ntoa(icpState->me.sin_addr), + (int) Config.Accel.port, + url); + debug(12, 5, "VHOST REWRITE: '%s'\n", icpState->url); } else { url_sz = strlen(Config.Accel.prefix) + strlen(url) + Config.appendDomainLen + 1;