diff options
author | lado <herrlado@gmail.com> | 2013-04-01 00:11:19 +0200 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2013-04-01 00:11:19 +0200 |
commit | da1c6058c56059c064f55b81586d6079677fa1b4 (patch) | |
tree | d88900a569335af120e9d13709a2c37478bd56ee /vdr-vdrmanager/handler.cpp | |
parent | da671823efe4d9202b2df74d12b7b69d0bea56c0 (diff) | |
download | vdr-manager-da1c6058c56059c064f55b81586d6079677fa1b4.tar.gz vdr-manager-da1c6058c56059c064f55b81586d6079677fa1b4.tar.bz2 |
Feature #790
Diffstat (limited to 'vdr-vdrmanager/handler.cpp')
-rw-r--r-- | vdr-vdrmanager/handler.cpp | 16 |
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(); } } |