diff --git a/pvAccessApp/remote/codec.cpp b/pvAccessApp/remote/codec.cpp index 547072a..87abd57 100644 --- a/pvAccessApp/remote/codec.cpp +++ b/pvAccessApp/remote/codec.cpp @@ -194,19 +194,24 @@ namespace epics { _storedLimit = _socketBuffer->getLimit(); _socketBuffer->setLimit(std::min (_storedPosition + _storedPayloadSize, _storedLimit)); + bool postProcess = true; try { // handle response processApplicationMessage(); - + postProcess = false; postProcessApplicationMessage(); } catch(...) //finally { - if (!isOpen()) - return; - - postProcessApplicationMessage(); + if (postProcess) + { + if (!isOpen()) + return; + + postProcessApplicationMessage(); + } + throw; } } @@ -891,7 +896,6 @@ namespace epics { "AbstractCodec::processSendQueue enter: (threadId: %u)", epicsThreadGetIdSelf()); - try { std::size_t senderProcessed = 0; while (senderProcessed++ < MAX_MESSAGE_SEND) @@ -920,11 +924,6 @@ namespace epics { processSender(sender); } } - //TODO MATEJ CHECK - //InterruptedException ie - catch (...) { - // noop, allowed and expected in blocking - } // flush if (_sendBuffer->getPosition() > 0) diff --git a/pvAccessApp/remote/codec.h b/pvAccessApp/remote/codec.h index 58f2c3c..ba4a777 100644 --- a/pvAccessApp/remote/codec.h +++ b/pvAccessApp/remote/codec.h @@ -126,7 +126,7 @@ namespace epics { { epics::pvData::Lock lock(_queueMutex); - _queue.push_front(elem); + _queue.push_back(elem); } _queueEvent.signal();