Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

06-edge.t fails with curl 7.35.0 because it is resetting port 0 to 80 #9

Closed
dfortner opened this Issue · 4 comments

3 participants

@dfortner
$ perl -Mblib  t/06-edge.t
# it's OK to see warnings here
Invalid libcurl constant: CURLOPT__DUMMY1 at t/06-edge.t line 12.
ok 1 - An object of class 'Net::Curl::Easy' isa 'Net::Curl::Easy'
not ok 2 - bad address 1
#   Failed test 'bad address 1'
#   at t/06-edge.t line 27.
not ok 3 - bad address 2
#   Failed test 'bad address 2'
#   at t/06-edge.t line 28.
#                   'OK'
#     doesn't match '(?^ix:couldn't\s+connect\s+to\s+server)'
1..3
# Looks like you failed 2 tests of 3.

Curl appears to be connecting to my local webserver on port 80, instead of letting the OS determine a random available port. This may be a bug introduced in the latest curl (7.35.0). Reported upstream here:
https://sourceforge.net/p/curl/bugs/1337/

Maybe it would be safer to have the test set up a server to explicitly reject the connection.

@creaktive
Owner

Interesting issue. Could you please try this patch for the test?

diff --git a/t/06-edge.t b/t/06-edge.t
index 9522916..f01fe63 100644
--- a/t/06-edge.t
+++ b/t/06-edge.t
@@ -8,11 +8,12 @@ BEGIN {
     diag q(it's OK to see warnings here);
 }

+use Net::Curl::Easy;
 use LWP::Protocol::Net::Curl
+    IPRESOLVE => Net::Curl::Easy::CURL_IPRESOLVE_V4,
     _DUMMY1 => 12345;

 use LWP::UserAgent;
-use Net::Curl::Easy;

 local $ENV{no_proxy} = '*';
@dfortner

Doesn't work. But I wouldn't expect it to, since curl --ipv4 http://127.0.0.1:0/ also exhibits the problem.

@davel

I am seeing that test fail in a different way,

perl -Ilib t/06-edge.t 
# it's OK to see warnings here
Invalid libcurl constant: CURLOPT__DUMMY1 at t/06-edge.t line 12.
ok 1 - The object isa Net::Curl::Easy
ok 2 - bad address 1
not ok 3 - bad address 2
#   Failed test 'bad address 2'
#   at t/06-edge.t line 28.
#                   'HTTP::Response=HASH(0x1ce16c0)'
#     doesn't match '(?ix-sm:couldn't\s+connect\s+to\s+server)'
1..3
# Looks like you failed 1 test of 3.

This is on Ubuntu 10.04.04.

@creaktive
Owner

OK, instead using inexistent port, let's use inexistent IP (0.42.42.42) :)

@creaktive creaktive closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.