Repository: qpid-cpp Updated Branches: refs/heads/master 49e3afbc6 -> b3559ee9c
QPID-7901: Prevent endless detach cycle Don't send a detach when there is an exception on a session that is already detached. Prevents an endless detach loop between the ends of the connection. Project: http://git-wip-us.apache.org/repos/asf/qpid-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-cpp/commit/b3559ee9 Tree: http://git-wip-us.apache.org/repos/asf/qpid-cpp/tree/b3559ee9 Diff: http://git-wip-us.apache.org/repos/asf/qpid-cpp/diff/b3559ee9 Branch: refs/heads/master Commit: b3559ee9c66f791c39a4e86f87bc1533b7eb0ba5 Parents: 49e3afb Author: Alan Conway <acon...@redhat.com> Authored: Mon Aug 28 09:47:39 2017 -0400 Committer: Alan Conway <acon...@redhat.com> Committed: Mon Aug 28 10:00:57 2017 -0400 ---------------------------------------------------------------------- src/qpid/amqp_0_10/SessionHandler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/b3559ee9/src/qpid/amqp_0_10/SessionHandler.cpp ---------------------------------------------------------------------- diff --git a/src/qpid/amqp_0_10/SessionHandler.cpp b/src/qpid/amqp_0_10/SessionHandler.cpp index bd0dcbf..85770c5 100644 --- a/src/qpid/amqp_0_10/SessionHandler.cpp +++ b/src/qpid/amqp_0_10/SessionHandler.cpp @@ -101,7 +101,15 @@ void SessionHandler::handleIn(AMQFrame& f) { if (getState()) commandId = getState()->receiverGetCurrent(); execution.exception(e.code, commandId, m ? m->amqpClassId() : 0, m ? m->amqpMethodId() : 0, 0, e.what(), FieldTable()); detaching(); - sendDetach(); + + // Only send detach if sending is viable, otherwise get out + if (sendReady) { + sendDetach(); + } + else { + // Throw this session away + handleDetach(); + } } catch(const ChannelException& e){ channelException(e.code, e.what()); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org