summaryrefslogtreecommitdiff
path: root/vdr-vdrmanager/handler.cpp
diff options
context:
space:
mode:
authorbju <bju@maxi.fritz.box>2013-03-24 04:14:45 +0100
committerbju <bju@maxi.fritz.box>2013-03-24 23:44:04 +0100
commit3cc7911fedcbea2337237a04658495b369c73d35 (patch)
treeb2671551f65d6b2c02cad2ee0bb072fac45f0ff4 /vdr-vdrmanager/handler.cpp
parentdbf28d356eb97b3075229bbc42a8a3ccf1c94ec0 (diff)
downloadvdr-manager-compression.tar.gz
vdr-manager-compression.tar.bz2
the answer traffic is now compressed if enabled on the server using zip or gzipcompression
Diffstat (limited to 'vdr-vdrmanager/handler.cpp')
-rw-r--r--vdr-vdrmanager/handler.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/vdr-vdrmanager/handler.cpp b/vdr-vdrmanager/handler.cpp
index 43b500a..ea15296 100644
--- a/vdr-vdrmanager/handler.cpp
+++ b/vdr-vdrmanager/handler.cpp
@@ -17,6 +17,8 @@ bool cHandler::HandleNewClient(cVdrmanagerClientSocket * sock)
bool cHandler::HandleClientRequest(cVdrmanagerClientSocket * sock)
{
+ bool closeSocket = true;
+
while(sock->Read())
{
// get lines
@@ -48,6 +50,12 @@ bool cHandler::HandleClientRequest(cVdrmanagerClientSocket * sock)
sock->SetLoggedIn();
sock->PutLine("!OK\r\n");
}
+ closeSocket = false;
+ }
+ else if (cmd == "COMPRESS")
+ {
+ sock->ActivateCompression();
+ closeSocket = false;
}
else if (cmd == "TIMERS")
{
@@ -97,9 +105,15 @@ bool cHandler::HandleClientRequest(cVdrmanagerClientSocket * sock)
else if (cmd == "QUIT")
{
// close socket
- sock->PutLine(string("Good bye! :-)\n"));
+ sock->PutLine(string("Good bye! :-)\r\n"));
sock->Disconnect();
}
+
+ if (closeSocket) {
+ sock->Disconnect();
+ }
+
+ sock->Flush();
}
}