mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
HttpUtils.pm: set socket to nonbocking (Forum #100247)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@19349 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
21eb126cf8
commit
a4eaafcbda
@ -592,9 +592,11 @@ HttpUtils_Connect2($)
|
||||
delete($hash->{httpheader});
|
||||
$hash->{NAME} = "" if(!defined($hash->{NAME}));
|
||||
my %timerHash = (hash=>$hash, checkSTS=>$selectTimestamp, msg=>"write to");
|
||||
$hash->{conn}->blocking(0);
|
||||
$hash->{directReadFn} = sub() {
|
||||
my $buf;
|
||||
my $len = sysread($hash->{conn},$buf,65536);
|
||||
return if(!defined($len) && $! == EWOULDBLOCK);
|
||||
$hash->{buf} .= $buf if(defined($len) && $len > 0);
|
||||
if(!defined($len) || $len <= 0 ||
|
||||
HttpUtils_DataComplete($hash)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user