diff --git a/pvAccessApp/remote/codec.cpp b/pvAccessApp/remote/codec.cpp index 72d6304..a96bebe 100644 --- a/pvAccessApp/remote/codec.cpp +++ b/pvAccessApp/remote/codec.cpp @@ -1023,10 +1023,14 @@ namespace epics { { try { bac->processRead(); - } catch (io_exception &e) { + } catch (std::exception &e) { LOG(logLevelWarn, "an exception caught while in receiveThread at %s:%d: %s", __FILE__, __LINE__, e.what()); + } catch (...) { + LOG(logLevelWarn, + "unknown exception caught while in sendThread at %s:%d", + __FILE__, __LINE__); } } @@ -1046,10 +1050,21 @@ namespace epics { { try { bac->processWrite(); - } catch (io_exception &e) { + } catch (connection_closed_exception &cce) { + // noop + /* + LOG(logLevelDebug, + "connection closed by remote host while in sendThread at %s:%d: %s", + __FILE__, __LINE__, e.what()); + */ + } catch (std::exception &e) { LOG(logLevelWarn, "an exception caught while in sendThread at %s:%d: %s", __FILE__, __LINE__, e.what()); + } catch (...) { + LOG(logLevelWarn, + "unknown exception caught while in sendThread at %s:%d", + __FILE__, __LINE__); } } diff --git a/testApp/remote/testCodec.cpp b/testApp/remote/testCodec.cpp index 8adb5c3..52b0d49 100644 --- a/testApp/remote/testCodec.cpp +++ b/testApp/remote/testCodec.cpp @@ -589,13 +589,15 @@ namespace epics { codec._readBuffer->put(PVA_VERSION); codec._readBuffer->put(invalidFlagsValues[i]); codec._readBuffer->put((int8_t)0x23); - codec._readBuffer->putInt(0); + //codec._readBuffer->putInt(0); + codec._readBuffer->putInt(i); // to check zero-payload codec._readBuffer->flip(); codec.processRead(); - testOk(codec._invalidDataStreamCount == 1, - "%s: codec._invalidDataStreamCount == 1", + testOk(codec._invalidDataStreamCount == (i != 0 ? 1 : 0), + //testOk(codec._invalidDataStreamCount == 1, + "%s: codec._invalidDataStreamCount == 1", CURRENT_FUNCTION); testOk(codec._closedCount == 0, "%s: codec._closedCount == 0", CURRENT_FUNCTION);