> Subject: weird transparent HTTP/1.0 handling
> 
> oops version 1.4.22
> 
> There's a strange error handling http/1.0 transparency. oops is my
> transproxy, using a squid parent at parent.hu, which fortunately tells
> the bad url as well when there's a problem.
> 
> Somehow oops tries to connect port 20480 instead of port 80, and I don't 
> get why. Idea?
> 
> (oops is on 3128, and transparent from 80 using linux's ipchains.)

This is bug! In the example you show oops have have to fetch destination
from ipchains (that is from socket structure). And 20480 is 80 in wrong
byteorder:
$ bc
obase=16
20480
5000
obase=10
ibase=16
0050
80

So, please, try attached patch, and inform me if it helps.


> 
> ===============/ session log /=============
> 
> grin@Yikes:~$ telnet www.av.com 80
> Trying 209.73.164.94...
> Connected to altavista.com.
> Escape character is '^]'.
> GET /foo HTTP/1.0
> 
> 
> HTTP/1.0 503 Service Unavailable
> Server: Squid/2.3.STABLE4-hno.20000819
> Mime-Version: 1.0
> Date: Thu, 30 Nov 2000 03:06:27 GMT
> Content-Type: text/html
> Content-Length: 761
> Expires: Thu, 30 Nov 2000 03:06:27 GMT
> X-Squid-Error: ERR_CONNECT_FAIL 111
> X-Cache: MISS from proxy.parent.hu
> X-Cache-Lookup: MISS from proxy.parent.hu:3128
> Proxy-Connection: close
> 
> <HTML><HEAD>
> <TITLE>ERROR: The requested URL could not be retrieved</TITLE>
> </HEAD><BODY>
> <H1>ERROR</H1>
> <H2>The requested URL could not be retrieved</H2>
> <HR>
> <P>
> While trying to retrieve the URL:
> <A HREF="http://209.73.164.94:20480/foo">http://209.73.164.94:20480/foo</A>
> <P>
> The following error was encountered:
> <UL>
> <LI>
> <STRONG>
> Connection Failed
> </STRONG>
> </UL>
> 
> <P>
> The system returned:
> <PRE><I>    (111) Connection refused</I></PRE>
> 
> <P>
> The remote host or network may be down.  Please try the request again.
> <P>Your cache administrator is <A 
>HREF="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</A>.
> 
> <br clear="all">
> <hr noshade size=1>
> Generated Thu, 30 Nov 2000 03:06:27 GMT by proxy.parent.hu 
>(Squid/2.3.STABLE4-hno.20000819)
> </BODY></HTML>
> Connection closed by foreign host.
> 
> 

Igor Khasilev                     |
PACO Links, igor at paco dot net  |
Index: src/modules/transparent.c
===================================================================
RCS file: /usr/local/cvs/oops/src/modules/transparent.c,v
retrieving revision 1.13
diff -c -r1.13 transparent.c
*** transparent.c       2000/11/11 15:03:41     1.13
--- transparent.c       2000/11/30 07:57:44
***************
*** 227,233 ****
  #else
        /* last resort - take destination ip from my_sa */
        rq->url.host = my_inet_ntoa(&rq->my_sa);
!       rq->url.port = rq->my_sa.sin_port;
        goto notdone;
  #endif
      }
--- 227,233 ----
  #else
        /* last resort - take destination ip from my_sa */
        rq->url.host = my_inet_ntoa(&rq->my_sa);
!       rq->url.port = ntohs(rq->my_sa.sin_port);
        goto notdone;
  #endif
      }

Дати відповідь електронним листом