2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 01:46:08 +00:00

DevIo.pm: fix nonblocking SSL connections (Forum #126011)

git-svn-id: https://svn.fhem.de/fhem/trunk@25636 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2022-02-06 11:54:10 +00:00
parent 86ad09f807
commit c34bb3f6e7

View File

@ -79,6 +79,13 @@ DevIo_SimpleRead($)
my ($hash) = @_;
my $buf = DevIo_DoSimpleRead($hash);
if(length($buf) == 0 && $! == EWOULDBLOCK && $hash->{SSL} && $hash->{TCPDev}) {
my $es = $hash->{TCPDev}->errstr;
$hash->{wantWrite} = 1 if($es == &IO::Socket::SSL::SSL_WANT_WRITE);
$hash->{wantRead} = 1 if($es == &IO::Socket::SSL::SSL_WANT_READ);
return "";
}
###########
# Lets' try again: Some drivers return len(0) on the first read...
if(defined($buf) && length($buf) == 0) {