diff options
author | lado <herrlado@gmail.com> | 2013-04-03 10:00:02 +0200 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2013-04-03 10:00:02 +0200 |
commit | 7b14565379b6334090c84db2f8911b7757212e5b (patch) | |
tree | 6266cc964c56d0bfb6abae3c1fa9fc7298500000 /vdr-vdrmanager/handler.cpp | |
parent | f5b4b051f856fb5c58e1b9269d2a9f82e3c894f9 (diff) | |
download | vdr-manager-7b14565379b6334090c84db2f8911b7757212e5b.tar.gz vdr-manager-7b14565379b6334090c84db2f8911b7757212e5b.tar.bz2 |
current changes
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(); } } |