This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 813f87eef9e44682948e390b1d20a68ff283bad1
Author: Andrew Stitcher <[email protected]>
AuthorDate: Wed May 29 15:10:21 2024 -0400

    PROTON-2825: [C++ binding] Reject incoming transaction coordinator links
---
 cpp/src/messaging_adapter.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/cpp/src/messaging_adapter.cpp b/cpp/src/messaging_adapter.cpp
index 9eea6645f..f90cd7613 100644
--- a/cpp/src/messaging_adapter.cpp
+++ b/cpp/src/messaging_adapter.cpp
@@ -273,7 +273,14 @@ void on_link_local_open(messaging_handler& handler, 
pn_event_t* event) {
 }
 
 void on_link_remote_open(messaging_handler& handler, pn_event_t* event) {
-    pn_link_t *lnk = pn_event_link(event);
+    auto lnk = pn_event_link(event);
+    // Currently don't implement (transaction) coordinator
+    if (pn_terminus_get_type(pn_link_remote_target(lnk))==PN_COORDINATOR) {
+      auto error = pn_link_condition(lnk);
+      pn_condition_set_name(error, "amqp:not-implemented");
+      pn_link_close(lnk);
+      return;
+    }
     if (pn_link_state(lnk) & PN_LOCAL_UNINIT) { // Incoming link
         // Copy source and target from remote end.
         pn_terminus_copy(pn_link_source(lnk), pn_link_remote_source(lnk));


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to