Squid Restarted for method Trace with Entity body.

From: Senthil Kumar .R <serengar@dont-contact.us>
Date: Thu, 23 May 2002 09:25:54 +0530

Hi ,

   The squid got restarted, When TRACE with Entity body is given as
request.

Note :- This is Negative Test condition.

Here is the cache.log :-

httpSendRequest: FD 18:
TRACE / HTTP/1.0
Content-Length: 10
Via: 1.0 serengar-pc:3128 (Squid/2.4.STABLE1)
X-Forwarded-For: 127.0.0.1
Host: 192.168.100.253
Cache-Control: max-age=259200
Connection: keep-alive

2002/05/23 09:19:23| comm_write: FD 18: sz 194: hndl 0x807178c: data
0x8306400.
2002/05/23 09:19:23| cbdataLock: 0x8306400
2002/05/23 09:19:23| commSetSelect: FD 18 type 2
2002/05/23 09:19:23| cbdataUnlock: 0x8306738
2002/05/23 09:19:23| comm_poll: 1 FDs ready
2002/05/23 09:19:23| comm_poll: FD 18 ready for writing
2002/05/23 09:19:23| commHandleWrite: FD 18: off 0, sz 194.
2002/05/23 09:19:23| commHandleWrite: write() returns 194
2002/05/23 09:19:23| cbdataValid: 0x8306400
2002/05/23 09:19:23| httpSendRequestEntry: FD 18: size 194: errflag 0.
2002/05/23 09:19:23| pumpStart: FD 18, key
90C37A89F2705CC829420F904F2E49F9
2002/05/23 09:19:23| assertion failed: pump.c:107: "p != NULL"

  RFC states,

  4.3

     The presence of a message-body in a request is signaled by the
     inclusion of a Content-Length or Transfer-Encoding header field in
     the request's message-headers. A message-body MUST NOT be included
in
     a request if the specification of the request method (section
5.1.1)
     does not allow sending an entity-body in requests. A server SHOULD
     read and forward a message-body on any request; if the request
method
     does not include defined semantics for an entity-body, then the
     message-body SHOULD be ignored when handling the request.

 So Squid SHOULD ignore it.

We have fixed this ,

  it will ignore the Entity-body and process the Trace request.

Fix work:-

 diff http.c http.ctracefix
3c3
< * $Id: http.c,v 1.371.2.1 2001/01/12 00:51:49 wessels Exp $

---
>  * $Id: http.c,v 1.371.2.2 2001/07/11 22:58:20 wessels Exp $
518a519
>           err->request = requestLink((request_t *) request);
528a530
>           err->request = requestLink((request_t *) request);
739a742
>          if ( orig_request->method != METHOD_TRACE)
740a744,746
>          else
>                  continue ;
>
858c864
<     if (httpState->orig_request->content_length > 0)
---
>     if ((httpState->orig_request->content_length > 0) && (req->method
== METHOD_POST))
Please Revert back your comments.
regards
senthil
Received on Wed May 22 2002 - 22:59:31 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:29 MST