This patch fixes two bugs in httpSpecialClientSideHandler (local.c).

Setting variables in the local interface returns "503 Post aborted" when the
POST request cannot be read at once.  This function httpSpecialClientSideHandler
is called to handle remaining data, but it assumes incorrectly that the object
flag is OBJECT_INPROGRESS (and therefore fails); the flag is in fact
OBJECT_INITIAL.

Another bug, hidden by the previous one, is that httpSpecialClientSideHandler
always return "502 Incomplete client request", even when the request is complete
and handled correctly by httpSpecialDoSide.
---
 local.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/local.c b/local.c
index 82106c4..9be0321 100644
--- a/local.c
+++ b/local.c
@@ -361,7 +361,7 @@ httpSpecialClientSideHandler(int status,
     int push;
 
     if((request->object->flags & OBJECT_ABORTED) || 
-       !(request->object->flags & OBJECT_INPROGRESS)) {
+       !(request->object->flags & OBJECT_INITIAL)) {
         httpClientDiscardBody(connection);
         httpClientError(request, 503, internAtom("Post aborted"));
         return 1;
@@ -380,7 +380,7 @@ httpSpecialClientSideHandler(int status,
                connection->bodylen - connection->reqoffset);
     if(push > 0) {
         connection->reqlen += push;
-        httpSpecialDoSide(request);
+        return httpSpecialDoSide(request);
     }
 
     do_log(L_ERROR, "Incomplete client request.\n");
-- 
1.7.10.4


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Polipo-users mailing list
Polipo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/polipo-users

Reply via email to