diff options
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/amqp/Connection.cpp | 12 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 12 |
2 files changed, 20 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpid/broker/amqp/Connection.cpp b/qpid/cpp/src/qpid/broker/amqp/Connection.cpp index 076af79411..8d6516edee 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Connection.cpp +++ b/qpid/cpp/src/qpid/broker/amqp/Connection.cpp @@ -221,7 +221,11 @@ size_t Connection::decode(const char* buffer, size_t size) } return n; } else if (n == PN_ERR) { - throw Exception(qpid::amqp::error_conditions::DECODE_ERROR, QPID_MSG("Error on input: " << getError())); + std::string error; + checkTransportError(error); + QPID_LOG_CAT(error, network, id << " connection error: " << error); + out.abort(); + return 0; } else { return 0; } @@ -246,7 +250,11 @@ size_t Connection::encode(char* buffer, size_t size) } return 0; } else if (n == PN_ERR) { - throw Exception(qpid::amqp::error_conditions::INTERNAL_ERROR, QPID_MSG("Error on output: " << getError())); + std::string error; + checkTransportError(error); + QPID_LOG_CAT(error, network, id << " connection error: " << error); + out.abort(); + return 0; } else { haveOutput = false; return 0; diff --git a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp index 0969f76ae4..a0b16c2b4c 100644 --- a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp +++ b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp @@ -793,7 +793,11 @@ std::size_t ConnectionContext::decodePlain(const char* buffer, std::size_t size) lock.notifyAll(); return n; } else if (n == PN_ERR) { - throw MessagingException(QPID_MSG("Error on input: " << getError())); + std::string error; + checkTransportError(error); + QPID_LOG_CAT(error, network, id << " connection error: " << error); + transport->abort(); + return 0; } else { return 0; } @@ -818,7 +822,11 @@ std::size_t ConnectionContext::encodePlain(char* buffer, std::size_t size) if (notifyOnWrite) lock.notifyAll(); return n; } else if (n == PN_ERR) { - throw MessagingException(QPID_MSG("Error on output: " << getError())); + std::string error; + checkTransportError(error); + QPID_LOG_CAT(error, network, id << " connection error: " << error); + transport->abort(); + return 0; } else if (n == PN_EOS) { haveOutput = false; // Normal close, or error? |
