summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2018-04-11 14:56:37 +0200
committerAndy Polyakov <appro@openssl.org>2018-04-13 10:14:27 +0200
commitb4c1950d8914775db503d8ab931735325032a40d (patch)
treee1cefe48115073690458a6f7bddd1791fd8e079b
parentTLSProxy/Proxy.pm: handle -1 as return value from waitpid. (diff)
downloadopenssl-b4c1950d8914775db503d8ab931735325032a40d.tar.xz
openssl-b4c1950d8914775db503d8ab931735325032a40d.zip
TLSProxy/Proxy.pm: handle "impossible" failure to connect to s_server.
The failure is "impossible", because we have confirmation that s_server listens, yet Mac OS X fails to connect. This avoids 10 minutes timeout on Travis CI. Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5907)
Diffstat (limited to '')
-rw-r--r--util/perl/TLSProxy/Proxy.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/util/perl/TLSProxy/Proxy.pm b/util/perl/TLSProxy/Proxy.pm
index 19b09a4744..45d88bffaa 100644
--- a/util/perl/TLSProxy/Proxy.pm
+++ b/util/perl/TLSProxy/Proxy.pm
@@ -189,10 +189,16 @@ sub connect_to_server
$servaddr =~ s/[\[\]]//g; # Remove [ and ]
- $self->{server_sock} = $IP_factory->(PeerAddr => $servaddr,
- PeerPort => $self->{server_port},
- Proto => 'tcp')
- or die "unable to connect: $!\n";
+ my $sock = $IP_factory->(PeerAddr => $servaddr,
+ PeerPort => $self->{server_port},
+ Proto => 'tcp');
+ if (!defined($sock)) {
+ my $err = $!;
+ kill(3, $self->{real_serverpid});
+ die "unable to connect: $err\n";
+ }
+
+ $self->{server_sock} = $sock;
}
sub start