codec: fixed bugs in codec, now entire test passes

This commit is contained in:
Matej Sekoranja
2014-02-14 21:55:27 +01:00
parent 2e184d62e8
commit 13cf6f0d6a
2 changed files with 11 additions and 12 deletions

View File

@@ -194,19 +194,24 @@ namespace epics {
_storedLimit = _socketBuffer->getLimit();
_socketBuffer->setLimit(std::min<std::size_t>
(_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)

View File

@@ -126,7 +126,7 @@ namespace epics {
{
epics::pvData::Lock lock(_queueMutex);
_queue.push_front(elem);
_queue.push_back(elem);
}
_queueEvent.signal();