]> git.ipfire.org Git - thirdparty/squid.git/commit
Author: Alex Rousskov <rousskov@measurement-factory.com>
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 20 Dec 2010 06:12:57 +0000 (23:12 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 20 Dec 2010 06:12:57 +0000 (23:12 -0700)
commit2b64ddfdac6a714d8689d735534175758c45eff1
tree05a29a017b383cc75225cf161aa49a0aadbcba85
parenteb4697c20421cb7ef3592dfc537284d35b7f742f
Author: Alex Rousskov <rousskov@measurement-factory.com>
HTTP/1.1: do not forward TRACE with Max-Forwards: 0 after REQMOD

Before the change, Max-Forwards request value was cached in
HttpRequest::max_forwards member. It was set once in
clientProcessRequest() function. This works fine as long as no request
adaptation is performed. Otherwise original HTTP request may be
replaced with adopted one in ClientHttpRequest::noteAdaptationAnswer()
method and max_forwards value is lost.

This change removes HttpRequest::max_forwards member and gets the value
directly from HttpHeader when needed. This adds another string-to-int
conversion for TRACE and OPTIONS requests, but those are rare, and we
save a little in the other, far more common cases by removing the
HttpRequest::max_forwards member.

Removed assertion from clientReplyContext::traceReply() since it is
called from a single place and the condition is checked right before
the call.

Co-Advisors test cases:
    test_case/rfc2616/maxForwardsZero-TRACE-asterisk
    test_case/rfc2616/maxForwardsZero-TRACE-absolute
src/HttpRequest.cc
src/HttpRequest.h
src/client_side.cc
src/client_side_reply.cc
src/url.cc