mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 02:45:22 +00:00
THRIFT-3643 Perl SSL server crushes if a client disconnect without handshake
Client: Perl Patch: Nobuaki Sukegawa This closes #874
This commit is contained in:
parent
19a3a2771a
commit
b16a0a94fc
@ -54,7 +54,9 @@ sub __close
|
||||
{
|
||||
my $self = shift;
|
||||
my $sock = ($self->{handle}->handles())[0];
|
||||
$sock->close(SSL_no_shutdown => 1);
|
||||
if ($sock) {
|
||||
$sock->close(SSL_no_shutdown => 1);
|
||||
}
|
||||
}
|
||||
|
||||
sub __recv
|
||||
@ -63,8 +65,10 @@ sub __recv
|
||||
my $sock = shift;
|
||||
my $len = shift;
|
||||
my $buf = undef;
|
||||
if ($sock) {
|
||||
sysread($sock, $buf, $len);
|
||||
return $buf;
|
||||
}
|
||||
return $buf;
|
||||
}
|
||||
|
||||
sub __send
|
||||
@ -79,7 +83,7 @@ sub __wait
|
||||
{
|
||||
my $self = shift;
|
||||
my $sock = ($self->{handle}->handles())[0];
|
||||
if ($sock->pending() eq 0) {
|
||||
if ($sock and $sock->pending() eq 0) {
|
||||
return $self->SUPER::__wait();
|
||||
}
|
||||
return $sock;
|
||||
|
Loading…
Reference in New Issue
Block a user