summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schmirler <vdr@schmirler.de>2011-11-27 11:32:16 +0100
committerFrank Schmirler <vdr@schmirler.de>2011-11-27 11:32:16 +0100
commit94aef85adc9c2922205145550ff00e59c694e36d (patch)
tree4d8d7e46e44a5f6fe0d3e8b67fc290edb403b353
parent9b91301d943cfbec5208419704cfece84267223d (diff)
downloadvdr-plugin-streamdev-94aef85adc9c2922205145550ff00e59c694e36d.tar.gz
vdr-plugin-streamdev-94aef85adc9c2922205145550ff00e59c694e36d.tar.bz2
Moved "closing connection" log message to overload of cTBSocket::Close() in
cServerConnection.
-rw-r--r--server/connection.c7
-rw-r--r--server/connection.h3
-rw-r--r--server/server.c5
3 files changed, 12 insertions, 3 deletions
diff --git a/server/connection.c b/server/connection.c
index f152f02..9b57980 100644
--- a/server/connection.c
+++ b/server/connection.c
@@ -237,6 +237,13 @@ bool cServerConnection::Respond(const char *Message, bool Last, ...)
return true;
}
+bool cServerConnection::Close()
+{
+ if (IsOpen())
+ isyslog("streamdev-server: closing %s connection to %s:%d", Protocol(), RemoteIp().c_str(), RemotePort());
+ return cTBSocket::Close();
+}
+
#if APIVERSNUM >= 10700
static int GetClippedNumProvidedSystems(int AvailableBits, cDevice *Device)
{
diff --git a/server/connection.h b/server/connection.h
index e7e3f1e..0d7a1a0 100644
--- a/server/connection.h
+++ b/server/connection.h
@@ -103,6 +103,9 @@ public:
/* Will make the socket close after sending all queued output data */
void DeferClose(void) { m_DeferClose = true; }
+ /* Close the socket */
+ virtual bool Close(void);
+
/* Will retrieve an unused device for transmitting data. Receivers have
already been attached from the device if necessary. Use the returned
cDevice in a following call to StartTransfer */
diff --git a/server/server.c b/server/server.c
index bc12f5d..8dd122e 100644
--- a/server/server.c
+++ b/server/server.c
@@ -152,9 +152,8 @@ void cStreamdevServer::Action(void)
cServerConnection *next = m_Clients.Next(s);
if (!result) {
- isyslog("streamdev: closing streamdev connection to %s:%d",
- s->RemoteIp().c_str(), s->RemotePort());
- s->Close();
+ if (s->IsOpen())
+ s->Close();
Lock();
m_Clients.Del(s);
Unlock();