squid 3.1 ICAP problem

From: Dan Searle <dan.searle_at_censornet.com>
Date: Fri, 23 Apr 2010 16:43:49 +0100

Hi,

Symptoms: Squid 3.1 fails to interoperate correctly with an ICAP server
and gives the error "ICAP protocol error." in the browser.

Config:
---snip---
icap_enable on
icap_service service_req reqmod_precache 0 icap://localhost:1344/reqmod
icap_class class_req service_req
icap_access class_req allow all
---snip---

Detail:
I'm writing an ICAP server from scratch and as far as I can see from
RFC3507 and errata, there is nothing wrong with this transaction shown
below in tcpdump -X format:

16:36:29.552198 IP localhost.50566 > localhost.1344: P 1:72(71) ack 1
win 513 <nop,nop,timestamp 62423291 62423291>
        0x0000: 4500 007b 341c 4000 4006 085f 7f00 0001 E..{4.@.@.._....
        0x0010: 7f00 0001 c586 0540 bd99 b4e2 bdca fa3d .......@.......=
        0x0020: 8018 0201 fe6f 0000 0101 080a 03b8 80fb .....o..........
        0x0030: 03b8 80fb 4f50 5449 4f4e 5320 6963 6170 ....OPTIONS.icap
        0x0040: 3a2f 2f6c 6f63 616c 686f 7374 3a31 3334 ://localhost:134
        0x0050: 342f 7265 716d 6f64 2049 4341 502f 312e 4/reqmod.ICAP/1.
        0x0060: 300d 0a48 6f73 743a 206c 6f63 616c 686f 0..Host:.localho
        0x0070: 7374 3a31 3334 340d 0a0d 0a st:1344....
16:36:29.552205 IP localhost.1344 > localhost.50566: . ack 72 win 512
<nop,nop,timestamp 62423291 62423291>
        0x0000: 4500 0034 7ac6 4000 4006 c1fb 7f00 0001 E..4z.@.@.......
        0x0010: 7f00 0001 0540 c586 bdca fa3d bd99 b529 .....@.....=...)
        0x0020: 8010 0200 77c1 0000 0101 080a 03b8 80fb ....w...........
        0x0030: 03b8 80fb ....
16:36:29.552442 IP localhost.1344 > localhost.50566: P 1:195(194) ack 72
win 512 <nop,nop,timestamp 62423291 62423291>
        0x0000: 4500 00f6 7ac7 4000 4006 c138 7f00 0001 E...z.@.@..8....
        0x0010: 7f00 0001 0540 c586 bdca fa3d bd99 b529 .....@.....=...)
        0x0020: 8018 0200 feea 0000 0101 080a 03b8 80fb ................
        0x0030: 03b8 80fb 3230 3020 4f4b 0d0a 4461 7465 ....200.OK..Date
        0x0040: 3a20 4672 692c 2032 3320 4170 7220 3230 :.Fri,.23.Apr.20
        0x0050: 3130 2031 363a 3336 3a32 3920 2b30 3130 10.16:36:29.+010
        0x0060: 300d 0a53 6572 7665 723a 2043 656e 736f 0..Server:.Censo
        0x0070: 724e 6574 2f35 2e30 0d0a 4d65 7468 6f64 rNet/5.0..Method
        0x0080: 733a 2052 4551 4d4f 440d 0a53 6572 7669 s:.REQMOD..Servi
        0x0090: 6365 3a20 4365 6e73 6f72 4e65 7420 4943 ce:.CensorNet.IC
        0x00a0: 4150 2052 4551 4d4f 440d 0a49 5354 6167 AP.REQMOD..ISTag
        0x00b0: 3a20 2230 220d 0a45 6e63 6170 7375 6c61 :."0"..Encapsula
        0x00c0: 7465 643a 206e 756c 6c2d 626f 6479 3d30 ted:.null-body=0
        0x00d0: 0d0a 4d61 782d 436f 6e6e 6563 7469 6f6e ..Max-Connection
        0x00e0: 733a 2031 3030 0d0a 416c 6c6f 773a 2032 s:.100..Allow:.2
        0x00f0: 3034 0d0a 0d0a 04....

What is my ICAP server doing wrong that squid is complaining about? I.e.
what is the cause of the protocol error?

Regards, Dan...

-- 
Dan Searle
CensorNet Ltd - professional & affordable Web & E-mail filtering
email: dan.searle_at_censornet.com web: www.censornet.com
tel: 0845 230 9590 / fax: 0845 230 9591 / support: 0845 230 9592
snail: Vallon House, Vantage Court Office Park, Winterbourne,
       Bristol, BS16 1GW, UK.
CensorNet Ltd is a registered company in England & Wales No. 05518629
VAT registration number 901-2048-78
Any views expressed in this email communication are those of the
individual sender, except where the sender specifically states them to
be the views of a member of Censornet Ltd.  Censornet Ltd. does not
represent, warrant or guarantee that the integrity of this
communication has been maintained nor that the communication is free
of errors or interference. 
------------------------------------------------------------------------------------
Scanned for viruses, spam and offensive content by CensorNet MailSafe
Try CensorNet free for 14 days. Provide Internet access on your terms.
Visit www.censornet.com for more information.
Received on Sun Apr 25 2010 - 20:11:05 MDT

This archive was generated by hypermail 2.2.0 : Mon Apr 26 2010 - 12:00:13 MDT