On Mon, Nov 12, 2012 at 05:23:09PM +0000, David Röthlisberger wrote:
> With curl, I *once* got the following error from polipo when I killed the
> curl process:
> 
>     Incomplete client request.
>     Assertion failed: (!object->chunks[i].locked), function destroyObject, 
> file object.c, line 661.
>     Abort trap: 6           ./polipo

Curl sends the request in 2 steps, with a one second delay:

20:43:05 sendto(3, "POST /polipo/config HTTP/1.1\r\nUser-Agent: 
curl/7.26.0\r\nHost: localhost:8123\r\nAccept: */*\r\nContent-Length: 
150\r\nExpect: 100-continue\r\nContent-Type: multipart/form-data; 
boundary=----------------------------402bc93a61dc\r\n\r\n", 221, MSG_NOSIGNAL, 
NULL, 0) = 221
20:43:06 sendto(3, 
"------------------------------402bc93a61dc\r\nContent-Disposition: form-data; 
name=\"clientTimeout\"\r\n\r\n3m\r\n------------------------------402bc93a61dc--\r\n",
 150, MSG_NOSIGNAL, NULL, 0) = 150

The assertion fails when you kill curl after polipo has read the headers but
before it reads the content of the POST request, in which case polipo
(correctly) tries to reply with a "502 request incomplete":

20:47:42 read(6, "POST /polipo/config HTTP/1.1\r\nUs"..., 8192) = 221 20:47:43 
read(6, "", 8192)              = 0
# killing curl here
20:47:43 write(2, "Incomplete client request.\n", 27Incomplete client request.) 
= 27
20:47:43 read(7, 
"TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\f\0\0\0\f\0\0\0\0"..., 4096) = 2945
20:47:43 read(7, 
"TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\r\0\0\0\r\0\0\0\0"..., 4096) = 1863
20:47:43 write(6, "HTTP/1.1 502 Incomplete client r"..., 682) = 682
polipo: object.c:661:
destroyObject: Assertion `!object->chunks[i].locked' failed.
20:47:43 --- SIGABRT (Aborted) @ 0 (0) ---
20:47:43 +++ killed by SIGABRT +++

One the other hand, if you kill curl after polipo has read the request, it just
hangs:
20:50:55 read(4, "POST /polipo/config HTTP/1.1\r\nUs"..., 8192) = 221
20:50:56 read(4, "------------------------------2b"..., 8192) = 150
# killing curl here, polipo hangs

So we have a bug in how incomplete requests are handled, and we still have a bug
in the handling of requests arriving in several steps.

-- 
Gabriel

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Polipo-users mailing list
Polipo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/polipo-users

Reply via email to