From 71e85d96fd310d048975c935e34e1fb1cfbcff5e Mon Sep 17 00:00:00 2001
From: rudolfkoenig <>
Date: Fri, 30 Jun 2017 09:38:41 +0000
Subject: [PATCH] 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
---
fhem/FHEM/01_FHEMWEB.pm | 10 +++++-----
fhem/FHEM/TcpServerUtils.pm | 8 ++++----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm
index 294885870..6e53fd5bf 100755
--- a/fhem/FHEM/01_FHEMWEB.pm
+++ b/fhem/FHEM/01_FHEMWEB.pm
@@ -579,8 +579,8 @@ FW_Read($$)
$FW_RET, "FW_closeConn", 1) ){
Log3 $name, 4, "Closing connection $name due to full buffer in FW_Read"
if(!$hash->{isChild});
- TcpServer_Close( $hash );
FW_closeConn($hash);
+ TcpServer_Close($hash, 1);
}
}
@@ -705,7 +705,7 @@ FW_closeConn($)
my $cc = AttrVal($hash->{SNAME}, "closeConn",
$FW_userAgent && $FW_userAgent=~m/(iPhone|iPad|iPod)/);
if(!$FW_httpheader{Connection} || $cc) {
- TcpServer_Close($hash);
+ TcpServer_Close($hash, 1);
}
}
@@ -2783,7 +2783,7 @@ FW_logInform($$)
}
$msg = FW_htmlEscape($msg);
if(!FW_addToWritebuffer($ntfy, "
$msg
") ){
- TcpServer_Close($ntfy);
+ TcpServer_Close($ntfy, 1);
delete $logInform{$me};
}
}
@@ -2907,7 +2907,7 @@ FW_Notify($$)
join("\n", map { s/\n/ /gm; $_ } @data)."\n") ){
my $name = $ntfy->{NAME};
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")) {
my $name = $ntfy->{NAME};
Log3 $name, 4, "Closing connection $name due to full buffer in FW_Notify";
- TcpServer_Close($ntfy);
+ TcpServer_Close($ntfy, 1);
}
}
}
diff --git a/fhem/FHEM/TcpServerUtils.pm b/fhem/FHEM/TcpServerUtils.pm
index dc9d907c5..cedb6a705 100644
--- a/fhem/FHEM/TcpServerUtils.pm
+++ b/fhem/FHEM/TcpServerUtils.pm
@@ -171,9 +171,9 @@ TcpServer_SetSSL($)
sub
-TcpServer_Close($)
+TcpServer_Close($@)
{
- my ($hash) = @_;
+ my ($hash, $dodel) = @_;
my $name = $hash->{NAME};
if(defined($hash->{CD})) { # Clients
@@ -181,8 +181,8 @@ TcpServer_Close($)
delete($hash->{CD});
delete($selectlist{$name});
delete($hash->{FD}); # Avoid Read->Close->Write
- delete $attr{$name};
- delete $defs{$name};
+ delete $attr{$name} if($dodel);
+ delete $defs{$name} if($dodel);
}
if(defined($hash->{SERVERSOCKET})) { # Server
close($hash->{SERVERSOCKET});