I guess you missed a special case:

If the reverse proxy backend sends a response without a Content-Length header 
and without a Transfer-Encoding,
which is IMHO valid for HTTP 1.0 responses if the connection is closed after 
the response.
The following patch would fix this:

Index: modules/http/http_filters.c
===================================================================
--- modules/http/http_filters.c (revision 1485192)
+++ modules/http/http_filters.c (working copy)
@@ -394,8 +394,15 @@
         case BODY_LENGTH:
         case BODY_CHUNK_DATA: {

-            /* Ensure that the caller can not go over our boundary point. */
-            if (ctx->remaining < readbytes) {
+            /*
+             * Ensure that the caller can not go over our boundary point,
+             * BUT only if this is not a response by reverse proxy backend
+             * that sent no Content-Length header and has no transfer encoding
+             * which is valid for a non keep-alive HTTP 1.0 response.
+             */
+            if ((ctx->remaining < readbytes) && !((ctx->remaining == 0) &&
+                  (ctx->state == BODY_NONE) &&
+                  (f->r->proxyreq == PROXYREQ_RESPONSE))) {
                 readbytes = ctx->remaining;
             }
             if (readbytes > 0) {

Should I commit it?

Regards

Rüdiger

Reply via email to