Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
HTTP Proxy in Perl: Problem with accept() *Problem pin-pointed*
[b][red]This message was edited by gregster at 2003-11-24 15:9:49[/red][/b][hr]
I have managed to pin-point the source of the problem but don't quite know how to explain it:
If the first line (among the 2 listed after this paragraph) is used instead of the second one and an HTTP server sends back a response with status 302 found, I don't get any subsequent HTTP requests. (The 302 status informs the HTTP browser to search for the requested page at a different location: this location is specified in the HTTP header after "Location: "). If the second line is used, then the page specified after Location, is then requested...and the whole page is downloaded. Whereas if the first line is used, after the 302 status is sent back to the browser, there are no more requests that arrive from the client and the page isn't downloaded...
##$client_sock = $sock->accept() || die "accept $!";
accept ($client_sock, $sock)) || die "accept $!";
What's the difference between these 2 lines? One is blocking, the other isn't?
The rest of the code for the proxy is in my previous message.
0 · ·