2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 04:36:02 +00:00

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
This commit is contained in:
rudolfkoenig 2018-05-31 11:23:41 +00:00
parent fa4f4ef5f3
commit 1e2a491a05

View File

@ -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) {