myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-492


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-492-gb150898
Date: Mon, 25 Apr 2011 21:51:22 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".

The branch, master has been updated
       via  b1508982b8ed2deeb8ae3250ea230e5458925803 (commit)
      from  f0385054dd3832aed991be1f41f47fa0de39920a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------


commit b1508982b8ed2deeb8ae3250ea230e5458925803
Author: Giuseppe Scrivano <address@hidden>
Date:   Mon Apr 25 23:51:16 2011 +0200

    Proxy: cope correctly when a content-length equals to zero is specified.

diff --git a/myserver/src/http_handler/proxy/proxy.cpp 
b/myserver/src/http_handler/proxy/proxy.cpp
index fc30836..1bb6a4b 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -19,7 +19,6 @@
 #include <include/http_handler/proxy/proxy.h>
 
 #include <include/base/string/stringutils.h>
-
 #include <include/protocol/http/http_thread_context.h>
 #include <include/protocol/http/http.h>
 #include <include/protocol/url.h>
@@ -255,9 +254,9 @@ int Proxy::readPayLoad (HttpThreadContext* td,
                         int timeout,
                         string *serverTransferEncoding)
 {
-  size_t contentLength = 0;
+  size_t contentLength = ((size_t) -1);
 
-  size_t nbr = 0, nbw = 0, length = 0, inPos = 0;
+  size_t nbr = 0, nbw = 0, inPos = 0;
 
   /* Only the chunked transfer encoding is supported.  */
   if (serverTransferEncoding && serverTransferEncoding->compare ("chunked"))
@@ -270,8 +269,6 @@ int Proxy::readPayLoad (HttpThreadContext* td,
         return HttpDataHandler::RET_FAILURE;
     }
 
-  length = contentLength;
-
   /* If it is specified a transfer encoding read data using it.  */
   if (serverTransferEncoding)
     {
@@ -299,12 +296,14 @@ int Proxy::readPayLoad (HttpThreadContext* td,
     }
   else
     {
+      size_t length = contentLength;
+
       /* If it is not specified an encoding, read the data as it is.  */
       for (;;)
         {
           u_long len = td->buffer->getRealLength () - 1;
 
-          if (contentLength && length < len)
+          if (contentLength != ((size_t) -1) && length < len)
             len = length;
 
           if (len == 0)

-----------------------------------------------------------------------

Summary of changes:
 myserver/src/http_handler/proxy/proxy.cpp |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU MyServer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]