httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Steinmetz <...@domdv.de>
Subject Re: 2.1.2-alpha http/ftp proxy/cache problems
Date Wed, 29 Dec 2004 13:37:46 GMT
Mladen Turk wrote:
> So this is basically a forward proxy problem correct?
Yes.

I did a bit of digging and the following should give you some hint about 
the actual problem. My current dev version is svn revision 123634.

I did modify proxy_util.c to dump an additional log line (last line of 
code excerpt below):

     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                  "proxy: connecting %s to %s:%d", *url, uri->hostname,
                  uri->port);

     /* allocate these out of the specified connection pool
      * The scheme handler decides if this is permanent or
      * short living pool.
      */
     /* are we connecting directly, or via a proxy? */
     if (!proxyname) {
         *url = apr_pstrcat(p, uri->path, uri->query ? "?" : "",
                            uri->query ? uri->query : "",
                            uri->fragment ? "#" : "",
                            uri->fragment ? uri->fragment : "", NULL);
     }
     if (!conn->hostname) {
         if (proxyname) {
             conn->hostname = apr_pstrdup(conn->pool, proxyname);
             conn->port = proxyport;
         } else {
             conn->hostname = apr_pstrdup(conn->pool, uri->hostname);
             conn->port = uri->port;
         }
     }
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: %s:%d", 
conn->hostname, conn->port);


Now this spits out in the error log in case of the proxy error appearing:

[Wed Dec 29 14:24:25 2004] [debug] proxy_util.c(1627): proxy: connecting 
http://www.wetter.com/v2/?SID=&LANG=DE&LOC=0280&LOCFROM=0202&region=BY 
to www.wetter.com:80
[Wed Dec 29 14:24:25 2004] [debug] proxy_util.c(1651): proxy: 
images.freshmeat.net:80

So actually the connect request is fine but conn->hostname is already 
set in ap_proxy_determine_connection() which causes the connect for the 
proxy request to go to the wrong site.

I do hope this helps to solve the forward proxy bug.
-- 
Andreas Steinmetz                       SPAMmers use robotrap@domdv.de

Mime
View raw message