Polipo request times out; and polipo crashes
David Röthlisberger <[email protected]>
| Newsgroups | gmane.comp.web.polipo.user |
|---|---|
| Message-ID | <[email protected]> |
In trying to run curl's test suite against polipo, I found the following 2 issues: ISSUE 1. For client POST requests with RFC 2388 multipart/form-data content type, polipo's request to the origin server doesn't seem to be complete. The origin server complains of "request timeout" after one minute. To reproduce, you can run curl against the attached testwebserver.rb (see the head of the file for instructions on running it). This works (normal POST): http_proxy=http://localhost:8123/ curl --silent http://localhost:9393/ -d f=hello This doesn't (multipart/form-data POST): http_proxy=http://localhost:8123/ curl --silent http://localhost:9393/ -F f=hello If you don't trust my testwebserver, I reproduced the same issue against the webserver from curl's test suite (it's a bit more complicated to set up the test). In fact the same request to any server times out, even one that isn't expecting a POST at the requested URL. Here is a log using polipo logLevel=0xF0FFF (after patching log.h to allow detailed logging): polipo: Accepted client connection 0x106c03780 polipo: Client request: POST http://localhost:9393/ HTTP/1.1 polipo: C... localhost:9393. polipo: C localhost:9393. polipo: Server request: localhost: POST / (method 4 from 0 to -1, 0x106c03cc0 for 0x106c03a50) polipo: W... localhost:9393. polipo: R: http://localhost:9393/ (4) --- 1 minute delay... --- testwebserver: [2012-02-23 20:28:02] ERROR HTTPRequest#fixup: WEBrick::HTTPStatus::RequestTimeout occured. polipo: W localhost:9393. polipo: Server status: HTTP/1.1 408 Request Timeout (0x106c03cc0 for 0x106c03a50) polipo: 0x106c03cc0(0x106c03a50): offset = 0 polipo: Adding data to 0x106c03a50 (303) at 0: 303 bytes polipo: 0x106c03cc0(0x106c03a50): offset = 303 polipo: Done with server localhost:9393 connection (1) polipo: Serving on 0x106c03780 for 0x106c03a50: offset 0 len 303 curl: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> curl: <HTML> curl: <HEAD><TITLE>Request Timeout</TITLE></HEAD> curl: <BODY> curl: <H1>Request Timeout</H1> curl: WEBrick::HTTPStatus::RequestTimeout curl: <HR> curl: <ADDRESS> curl: WEBrick/1.3.1 (Ruby/1.8.7/2012-02-08) at curl: localhost:9393 curl: </ADDRESS> curl: </BODY> curl: </HTML> ISSUE 2. Intermittently, polipo crashes just after receiving the above timeout response from the server and serving it to the client. I can reproduce this 80% of the time on OS X, but so far not on Linux. In the test above, curl does print the 408 response from my testwebserver, so polipo has served the response before crashing. Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000 0x0000000100016ae6 in httpServerContinueConditionHandler (status=0, chandler=0x100103f60) at server.c:1156 1156 if(connection->request->flags & REQUEST_WAIT_CONTINUE) (gdb) bt #0 0x0000000100016ae6 in httpServerContinueConditionHandler (status=0, chandler=0x100103f60) at server.c:1156 #1 0x00000001000023cb in signalCondition (condition=0x100103b18) at event.c:813 #2 0x0000000100006fb9 in notifyObject (object=0x100103a70) at object.c:770 #3 0x0000000100017744 in httpServerFinish (connection=0x0, s=1064800, offset=1606415808) at server.c:1233 #4 0x0000000100018ef2 in httpServerReplyHandler (status=-65539, event=0x100103f60, srequest=0x100000000) at server.c:1831 #5 0x0000000100004629 in do_scheduled_stream (status=0, event=0x100103860) at io.c:240 #6 0x00000001000029d5 in pokeFdEventHandler (tevent=0x0) at event.c:569 #7 0x000000010000252c in runTimeEventQueue () at event.c:492 #8 0x0000000100002cf4 in eventLoop () at event.c:654 #9 0x000000010000d372 in main (argc=1, argv=0x7fff5fbff7c0) at main.c:165 (gdb) p connection $1 = (HTTPConnectionPtr) 0x100103ce0 (gdb) p connection->request $2 = (HTTPRequestPtr) 0x0 Cheers, David Röthlisberger ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Polipo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/polipo-users
testwebserver.rb
(text/x-ruby-script, 509 B)
# To run:
# yum install rubygem-sinatra rubygem-shotgun
# shotgun testwebserver.rb
#
# If your package manager doesn't have a 'rubygem-sinatra' package but does
# have a 'rubygems' package:
# yum install rubygems
# gem install sinatra shotgun
#
# See sinatrarb.com for information on the Sinatra web framework.
require 'sinatra'
get '/' do
<<-EOF
Hi!
<form action="/" method="post">
<input type="text" name="f" />
</form>
EOF
end
post '/' do
"You submitted: " + params[:f].to_s
end