Repository: qpid-proton Updated Branches: refs/heads/master fa677481c -> 3cb2ace54
PROTON-1416: Change handling of operator forced connection close - Treat as if no close from was received at all, so that the underlying transport close will force reconnect to take place. Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/3cb2ace5 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/3cb2ace5 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/3cb2ace5 Branch: refs/heads/master Commit: 3cb2ace54bb38a1506e4b3902cc1c557dce6d3ef Parents: fa67748 Author: Andrew Stitcher <[email protected]> Authored: Fri Feb 17 16:22:42 2017 -0500 Committer: Andrew Stitcher <[email protected]> Committed: Fri Feb 24 16:26:48 2017 -0500 ---------------------------------------------------------------------- proton-c/bindings/cpp/src/messaging_adapter.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/3cb2ace5/proton-c/bindings/cpp/src/messaging_adapter.cpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/src/messaging_adapter.cpp b/proton-c/bindings/cpp/src/messaging_adapter.cpp index 17c84cd..de35989 100644 --- a/proton-c/bindings/cpp/src/messaging_adapter.cpp +++ b/proton-c/bindings/cpp/src/messaging_adapter.cpp @@ -42,6 +42,8 @@ #include <proton/session.h> #include <proton/transport.h> +#include <string.h> + namespace proton { namespace { @@ -231,8 +233,18 @@ void messaging_adapter::on_session_remote_close(proton_event &pe) { void messaging_adapter::on_connection_remote_close(proton_event &pe) { pn_event_t *cevent = pe.pn_event(); pn_connection_t *conn = pn_event_connection(cevent); + pn_condition_t *cond = pn_connection_remote_condition(conn); + + // If we got a close with a condition of amqp:connection:forced then treat this + // the same as just having the transport closed by the peer without sending any + // events. This allows reconnection to happen transparently in this case + if (pn_condition_is_set(cond) + && !strcmp(pn_condition_get_name(cond),"amqp:connection:forced")) { + return; + } + connection c(make_wrapper(conn)); - if (pn_condition_is_set(pn_connection_remote_condition(conn))) { + if (pn_condition_is_set(cond)) { delegate_.on_connection_error(c); } delegate_.on_connection_close(c); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
