Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for nonblocking sockets [rt.cpan.org #43719] #213

Closed
oalders opened this issue Mar 31, 2017 · 1 comment
Closed

support for nonblocking sockets [rt.cpan.org #43719] #213

oalders opened this issue Mar 31, 2017 · 1 comment

Comments

@oalders
Copy link
Member

oalders commented Mar 31, 2017

Migrated from rt.cpan.org#43719 (status was 'open')

Requestors:

Attachments:

From antonio@dyne.org on 2009-02-28 00:20:16:

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;
 }

From dam@cpan.org on 2014-04-11 21:08:37:

�а 28 �ев�. 2009, �б 02:20:16, antonio напи�а:
> 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;
>  }

The attached patch is applied to the Debian package of libwww-perl.

Cheers,
  dam

From 216821@bugs.debian.org on 2014-04-11 21:18:13:

Thank you for the additional information you have supplied regarding
this Bug report.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>

If you wish to submit further information on this problem, please
send it to 216821@bugs.debian.org.

Please do not send mail to owner@bugs.debian.org unless you wish
to report a problem with the Bug-tracking system.

-- 
216821: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=216821
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
@gregoa
Copy link

gregoa commented May 12, 2019

From https://bugs.debian.org/914034 it looks like this patch is not only not needed anymore but actually detrimental for TLSv1.3 connections.

@genio genio closed this as completed May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants