Skip to content

Commit

Permalink
Debugging commit to be removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
fwh-dc committed Jan 19, 2024
1 parent 8990eb4 commit 1454ccf
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions util/perl/TLSProxy/Proxy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ sub connect_to_server
my $sock = $IP_factory->(PeerAddr => $servaddr,
PeerPort => $self->{server_port},
Proto => $self->{isdtls} ? 'udp' : 'tcp');
if (!defined($sock)) {
if (!defined($sock) || !$sock->connect()) {
my $err = $!;
kill(3, $self->{real_serverpid});
die "unable to connect: $err\n";
Expand Down Expand Up @@ -286,7 +286,7 @@ sub start
if ($self->serverflags ne "") {
$execcmd .= " ".$self->serverflags;
}
if ($self->debug) {
if (1) {
print STDERR "Server command: $execcmd\n";
}

Expand Down Expand Up @@ -348,11 +348,6 @@ sub start
print STDERR "Server responds on ",
"$self->{server_addr}:$self->{server_port}\n";

# Connect right away...
$self->connect_to_server();

print STDERR "Proxy connected to server\n";

return $self->clientstart;
}

Expand Down Expand Up @@ -393,7 +388,7 @@ sub clientstart
if (defined $self->sessionfile) {
$execcmd .= " -ign_eof";
}
if ($self->debug) {
if (1) {
print STDERR "Client command: $execcmd\n";
}

Expand Down Expand Up @@ -421,6 +416,13 @@ sub clientstart
close($savedout);
}

# Connect right away...
if ($self->{server_sock} == undef) {
$self->connect_to_server();
}

print STDERR "Proxy connected to server\n";

# Wait for incoming connection from client
print STDERR "Wait for incoming connection from client\n";
my $fdset = IO::Select->new($self->{proxy_sock});
Expand Down

0 comments on commit 1454ccf

Please sign in to comment.