From 510d13192c4dd089ff8a48e82cc2e564c939596c Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Thu, 31 May 2018 11:23:41 +0000 Subject: [PATCH] fhem.pl: fix reading with small buffer over SSL (Forum #73642) git-svn-id: https://svn.fhem.de/fhem/trunk@16802 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 52cfdd561..15d827a89 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -641,6 +641,7 @@ my $errcount= 0; $gotSig = undef if($gotSig && $gotSig eq "HUP"); while (1) { my ($rout,$rin, $wout,$win, $eout,$ein) = ('','', '','', '',''); + my $nfound = 0; my $timeout = HandleTimeout(); @@ -656,11 +657,15 @@ while (1) { } vec($ein, $hash->{EXCEPT_FD}, 1) = 1 if(defined($hash->{"EXCEPT_FD"})); + if($hash->{SSL} && $hash->{CD} && $hash->{CD}->pending()) { + vec($rout, $hash->{FD}, 1) = 1; + $nfound++; + } } $timeout = $readytimeout if(keys(%readyfnlist) && (!defined($timeout) || $timeout > $readytimeout)); $timeout = 5 if $winService->{AsAService} && $timeout > 5; - my $nfound = select($rout=$rin, $wout=$win, $eout=$ein, $timeout); + $nfound = select($rout=$rin, $wout=$win, $eout=$ein, $timeout) if(!$nfound); $winService->{serviceCheck}->() if($winService->{serviceCheck}); if($gotSig) {