CC: | 216821 [...] bugs.debian.org |
Subject: | support for nonblocking sockets |
Forwarding from http://bugs.debian.org/216821
---
When using the HTTP 1.1 protocol, LWP sets the socket nonblocking.
This means that connect(2) can fail with EINPROGRESS, and then LWP
should wait on the socket using select(2). However, LWP doesn't check
for EINPROGRESS; it instead just passes it back to the application
with code 500.
It's not clear to me why LWP uses nonblocking sockets for HTTP 1.1,
but not for HTTP 1.0, HTTPS 1.1, or HTTPS 1.0.
Here is a workaround:
--- lib/LWP/Protocol/http.pm.orig 2002-09-20 14:53:30.000000000 +0000
+++ lib/LWP/Protocol/http.pm 2003-10-21 03:54:06.000000000 +0000
@@ -48,7 +48,7 @@
}
# perl 5.005's IO::Socket does not have the blocking method.
- eval { $sock->blocking(0); };
+ #eval { $sock->blocking(0); };
$sock;
}