From f497c5e9323d49b856bf18bd501424e598ea2962 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 30 Apr 2012 12:50:11 +0200 Subject: [PATCH] Bugfix for the exception handling change. --- jsonrpc/jsonrpcclient.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/jsonrpc/jsonrpcclient.cpp b/jsonrpc/jsonrpcclient.cpp index e7f0f4c00..30b9e5b73 100644 --- a/jsonrpc/jsonrpcclient.cpp +++ b/jsonrpc/jsonrpcclient.cpp @@ -23,12 +23,13 @@ int JsonRpcClient::DataAvailableHandler(const EventArgs& ea) try { Message message; - if (Netstring::ReadMessageFromFIFO(GetRecvQueue(), &message)) { - NewMessageEventArgs nea; - nea.Source = shared_from_this(); - nea.Message = message; - OnNewMessage(nea); - } + if (!Netstring::ReadMessageFromFIFO(GetRecvQueue(), &message)) + break; + + NewMessageEventArgs nea; + nea.Source = shared_from_this(); + nea.Message = message; + OnNewMessage(nea); } catch (const Exception& ex) { Application::Log("Exception while processing message from JSON-RPC client: " + ex.GetMessage()); Close();