[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squid-cvs
Subject:    /bzr/squid3/trunk/ r12319: Do not reuse persistent connections for PUTs to avoid ERR_ZERO_SIZE_OBJEC
From:       Alex Rousskov <rousskov () measurement-factory ! com>
Date:       2012-09-10 23:07:01
Message-ID: 20120910231503.3303.qmail () squid-cache ! org
[Download RAW message or body]

--===============2116679880==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------
revno: 12319
committer: Alex Rousskov <rousskov@measurement-factory.com>
branch nick: trunk
timestamp: Mon 2012-09-10 17:07:01 -0600
message:
  Do not reuse persistent connections for PUTs to avoid ERR_ZERO_SIZE_OBJECT.
  
  A compliant proxy may retry PUTs, but Squid lacks the [rather complicated]
  code required to protect the PUT request body from being nibbled during the
  first try or [also tricky] code to send 100-continue expectation requiredto
  delay body sending. Thus, Squid cannot safely retry some PUTs today, and
  FwdState::checkRetriable() must return false for all PUTs, to avoid
  bogus ERR_ZERO_SIZE_OBJECT errors (especially for clients that did not
  reuse a pconn and, hence, may not be ready to handle/retry an error response).
  
  In theory, requests with safe or idempotent methods other than PUT might have
  bodies so we apply the same logic to them as well.
  
  This reopens Squid bug #3398, undoing trunk r11859 commit which attempted
  to close that bug.
modified:
  src/forward.cc

--===============2116679880==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; name="r12319.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

=== modified file 'src/forward.cc'
--- a/src/forward.cc	2012-08-28 19:12:13 +0000
+++ b/src/forward.cc	2012-09-10 23:07:01 +0000
@@ -561,6 +561,12 @@
 bool
 FwdState::checkRetriable()
 {
+    // Optimize: A compliant proxy may retry PUTs, but Squid lacks the [rather
+    // complicated] code required to protect the PUT request body from being
+    // nibbled during the first try. Thus, Squid cannot retry some PUTs today.
+    if (request->body_pipe != NULL)
+        return false;
+
     /* RFC2616 9.1 Safe and Idempotent Methods */
     switch (request->method.id()) {
         /* 9.1.1 Safe Methods */


--===============2116679880==--
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic