Repository: qpid-proton Updated Branches: refs/heads/master 4a6010110 -> 27f296ccd
Revert "PROTON-1258: Make transport events more consistent on client and server" This reverts commit 4a6010110296846e3c77defc0558a45d8792d3b5. This commit crashes the cpp_mt_example_test in a release build (but not in a debug or reldbg build which is worth investigating separtely) The connection engine relies on the events generated by correct use of pn_transport_t. PROTON-1258 is a reactor bug: the reactor needs to be fixed to close the transport correctly, before unbinding it, so that it can generate the proper close events in the proper sequence. The handler should not be involved. Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/27f296cc Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/27f296cc Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/27f296cc Branch: refs/heads/master Commit: 27f296ccdcbf720e03eee9e99ec88116887fc817 Parents: 4a60101 Author: Alan Conway <acon...@redhat.com> Authored: Fri Jul 15 14:23:26 2016 -0400 Committer: Alan Conway <acon...@redhat.com> Committed: Fri Jul 15 14:23:26 2016 -0400 ---------------------------------------------------------------------- proton-c/bindings/cpp/src/messaging_adapter.cpp | 25 +++++++------------- 1 file changed, 9 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/27f296cc/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 4d83871..e74fa4e 100644 --- a/proton-c/bindings/cpp/src/messaging_adapter.cpp +++ b/proton-c/bindings/cpp/src/messaging_adapter.cpp @@ -221,12 +221,10 @@ void messaging_adapter::on_connection_remote_close(proton_event &pe) { } void messaging_adapter::on_connection_remote_open(proton_event &pe) { - // Generate on_transport_open event here until we find a better place - transport t(make_wrapper(pn_event_transport(pe.pn_event()))); - delegate_.on_transport_open(t); - pn_connection_t *conn = pn_event_connection(pe.pn_event()); connection c(make_wrapper(conn)); + transport t(make_wrapper(pn_event_transport(pe.pn_event()))); + delegate_.on_transport_open(t); delegate_.on_connection_open(c); if (!is_local_open(pn_connection_state(conn)) && is_local_unititialised(pn_connection_state(conn))) { pn_connection_open(conn); @@ -266,20 +264,15 @@ void messaging_adapter::on_link_remote_open(proton_event &pe) { } void messaging_adapter::on_transport_tail_closed(proton_event &pe) { - pn_transport_t *tspt = pn_event_transport(pe.pn_event()); - transport t(make_wrapper(tspt)); - - // If the connection isn't open generate on_transport_open event - // because we didn't generate it yet and the events won't match. pn_connection_t *conn = pn_event_connection(pe.pn_event()); - if (!conn || is_local_unititialised(pn_connection_state(conn))) { - delegate_.on_transport_open(t); - } - - if (pn_condition_is_set(pn_transport_condition(tspt))) { - delegate_.on_transport_error(t); + if (conn && is_local_open(pn_connection_state(conn))) { + pn_transport_t *tspt = pn_event_transport(pe.pn_event()); + transport t(make_wrapper(tspt)); + if (pn_condition_is_set(pn_transport_condition(tspt))) { + delegate_.on_transport_error(t); + } + delegate_.on_transport_close(t); } - delegate_.on_transport_close(t); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org