[squid-users] Incorrect parsing logic while handling ICAP REQMOD responses

From: Shree Raman <Shree_Raman_at_symantec.com>
Date: Tue, 26 May 2009 23:25:28 -0700

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.

Regards,
Shree
Received on Wed May 27 2009 - 06:26:15 MDT

This archive was generated by hypermail 2.2.0 : Wed May 27 2009 - 12:00:02 MDT