summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2018-03-01 15:00:32 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2018-03-01 15:00:32 +0100
commit7b77f400a1ecd0952376c8fb8607291465730370 (patch)
tree02b536fecdcd3f5c319d24801300f3e28bc2de80
parent4d7455e783e0fd4f37651e2bd6570d0468ca1cd0 (diff)
downloadvdr-7b77f400a1ecd0952376c8fb8607291465730370.tar.gz
vdr-7b77f400a1ecd0952376c8fb8607291465730370.tar.bz2
Fixed handling close of connections
-rwxr-xr-xpeerdemo5
1 files changed, 3 insertions, 2 deletions
diff --git a/peerdemo b/peerdemo
index 3f0d5b19..8f2f70ff 100755
--- a/peerdemo
+++ b/peerdemo
@@ -75,7 +75,7 @@ while (1) {
my $Request = "";
$fh->recv($Request, 1024);
chomp($Request);
- Log('<', $fh, $Request);
+ Log('<', $fh, $Request) if ($Request);
if ($Request =~ /^CONN/) {
Reply($fh, "250 OK");
ReportVDR($Request, $fh->peerhost());
@@ -89,8 +89,9 @@ while (1) {
elsif ($Request =~ /^PING/) {
Reply($fh, "250 $Name is alive");
}
- elsif ($Request =~ /^QUIT/) {
+ elsif ($Request =~ /^QUIT/ || !$Request) {
# close connection:
+ Log('<', $fh, "connection closed");
$SvdrpSelect->remove($fh);
$fh->close;
}