On 05/27/2009 12:25 AM, Shree Raman wrote:
> Hello everyone,
>
> I am trying to use Squid as an ICAP client. I have moved to
> Squid-3.1.0.8 (latest beta release). I have noticed that some of the
> functionalities which worked for in Squid-3.0.Stable13 do not function
> as expected with this latest release (Squid-3.1.0.8).
>
> I made a debug build of squid and did a step through in the code to
> discover the problem. This issue was experienced when squid sends an
> ICAP reqmod request encapsulating a HTTP Post request to be sent an
> external server in the Internet and the ICAP Server responds back with
> an HTTP response (encapsulated in ICAP response) on behalf of external
> server. Loosely, it is equivalent of Example 3 in section 4.8.3 of RFC
> 3507.
>
> A step through in the build of Squid revealed that while parsing the
> received ICAP response, Squid was expecting an HTTP Request and not a
> HTTP Response (as sent by ICAP server on behalf of external server).
> Issue is seen when parseFirstLine() method (line 259 of HttpMsg.cc) is
> invoked in HttpMsg::httpMsgParseStep() method. Shouldn't there be a
> logic to check the first line of HTTP header and determine whether it
> should use HttpReply or HttpRequest class. I haven't developed a good
> knowledge to create a fix/patch for this issue. If any pro can provide
> some reference/guidance, then I can develop the fix.
>
> If you may need more information to help resolving this issue, then
> please send me an email.
The ICAP Encapsulated header determines the type of the HTTP message
inside the ICAP response. Can you check that the ICAP response Squid
receives has the right Encapsulated header (res-hdr versus req-hdr)?
In the slightly stale code I have looked at, Icap::ModXact creates
HttpRequest or HttpReply object depending on the ICAP Encapsulated
header value (see the maybeAllocateHttpMsg() method). Each HttpMsg kid
has its own parseFirstLine() method so the right first line parser
should be called if the object of the right type is created.
Please note that ICAP code uses HttpRequest parser for the ICAP headers.
This happens before the HTTP headers are parsed.
Thank you,
Alex.
Received on Wed May 27 2009 - 07:04:15 MDT
This archive was generated by hypermail 2.2.0 : Wed May 27 2009 - 12:00:02 MDT