2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

HttpUtils.pm: better error handling when conn is replaced (Forum #126593)

git-svn-id: https://svn.fhem.de/fhem/trunk@25784 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2022-03-06 09:20:24 +00:00
parent 4f5e536f94
commit 2c4a4e6c0d

View File

@ -509,6 +509,14 @@ HttpUtils_Connect2NonblockingSSL($$)
"HttpUtils_TimeoutErr", \%timerHash);
$hash->{directReadFn} = sub() {
if(!$hash->{conn}->can('connect_SSL')) { # 126593
my $err = "HttpUtils_Connect2NonblockingSSL: connection handle in ".
"$hash->{NAME} was replaced, terminating connection";
HttpUtils_Close($hash);
Log 1, $err;
return $hash->{callback}($hash, $err);
}
return if(!$hash->{conn}->connect_SSL() && $! == EWOULDBLOCK);
RemoveInternalTimer(\%timerHash);