From 539833c87b86871987dd0dff8944a60313c33728 Mon Sep 17 00:00:00 2001 From: Ken Giusti Date: Fri, 6 Feb 2015 21:10:24 +0000 Subject: QPID-5538: patch to work with older version of proton (0.7) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1657964 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/broker/amqp/Connection.cpp | 12 ++++++++++-- qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'qpid/cpp/src') 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? -- cgit v1.2.1