2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-19 12:46:03 +00:00

TcpServerUtils.pm: avoid fhem.pl log about missing DeleteFn (Forum #73490)

git-svn-id: https://svn.fhem.de/fhem/trunk@14603 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-06-30 09:38:41 +00:00
parent f3e7191ae8
commit 71e85d96fd
2 changed files with 9 additions and 9 deletions

View File

@ -579,8 +579,8 @@ FW_Read($$)
$FW_RET, "FW_closeConn", 1) ){ $FW_RET, "FW_closeConn", 1) ){
Log3 $name, 4, "Closing connection $name due to full buffer in FW_Read" Log3 $name, 4, "Closing connection $name due to full buffer in FW_Read"
if(!$hash->{isChild}); if(!$hash->{isChild});
TcpServer_Close( $hash );
FW_closeConn($hash); FW_closeConn($hash);
TcpServer_Close($hash, 1);
} }
} }
@ -705,7 +705,7 @@ FW_closeConn($)
my $cc = AttrVal($hash->{SNAME}, "closeConn", my $cc = AttrVal($hash->{SNAME}, "closeConn",
$FW_userAgent && $FW_userAgent=~m/(iPhone|iPad|iPod)/); $FW_userAgent && $FW_userAgent=~m/(iPhone|iPad|iPod)/);
if(!$FW_httpheader{Connection} || $cc) { if(!$FW_httpheader{Connection} || $cc) {
TcpServer_Close($hash); TcpServer_Close($hash, 1);
} }
} }
@ -2783,7 +2783,7 @@ FW_logInform($$)
} }
$msg = FW_htmlEscape($msg); $msg = FW_htmlEscape($msg);
if(!FW_addToWritebuffer($ntfy, "<div class='fhemlog'>$msg</div>") ){ if(!FW_addToWritebuffer($ntfy, "<div class='fhemlog'>$msg</div>") ){
TcpServer_Close($ntfy); TcpServer_Close($ntfy, 1);
delete $logInform{$me}; delete $logInform{$me};
} }
} }
@ -2907,7 +2907,7 @@ FW_Notify($$)
join("\n", map { s/\n/ /gm; $_ } @data)."\n") ){ join("\n", map { s/\n/ /gm; $_ } @data)."\n") ){
my $name = $ntfy->{NAME}; my $name = $ntfy->{NAME};
Log3 $name, 4, "Closing connection $name due to full buffer in FW_Notify"; Log3 $name, 4, "Closing connection $name due to full buffer in FW_Notify";
TcpServer_Close($ntfy); TcpServer_Close($ntfy, 1);
} }
} }
@ -2934,7 +2934,7 @@ FW_directNotify($@) # Notify without the event overhead (Forum #31293)
FW_longpollInfo($ntfy->{inform}{fmt}, @_)."\n")) { FW_longpollInfo($ntfy->{inform}{fmt}, @_)."\n")) {
my $name = $ntfy->{NAME}; my $name = $ntfy->{NAME};
Log3 $name, 4, "Closing connection $name due to full buffer in FW_Notify"; Log3 $name, 4, "Closing connection $name due to full buffer in FW_Notify";
TcpServer_Close($ntfy); TcpServer_Close($ntfy, 1);
} }
} }
} }

View File

@ -171,9 +171,9 @@ TcpServer_SetSSL($)
sub sub
TcpServer_Close($) TcpServer_Close($@)
{ {
my ($hash) = @_; my ($hash, $dodel) = @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
if(defined($hash->{CD})) { # Clients if(defined($hash->{CD})) { # Clients
@ -181,8 +181,8 @@ TcpServer_Close($)
delete($hash->{CD}); delete($hash->{CD});
delete($selectlist{$name}); delete($selectlist{$name});
delete($hash->{FD}); # Avoid Read->Close->Write delete($hash->{FD}); # Avoid Read->Close->Write
delete $attr{$name}; delete $attr{$name} if($dodel);
delete $defs{$name}; delete $defs{$name} if($dodel);
} }
if(defined($hash->{SERVERSOCKET})) { # Server if(defined($hash->{SERVERSOCKET})) { # Server
close($hash->{SERVERSOCKET}); close($hash->{SERVERSOCKET});