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 54db24fcb39c4e39f122d3069680eb20e93a3ac5
Author: Andrew Stitcher <[email protected]>
AuthorDate: Wed May 29 14:32:30 2024 -0400

    PROTON-2824: [C example beoker] Reject attempts to use transactions
    
    Close the link with an error if the client tries to attach to a
    tnasactions coordinator terminus.
---
 c/examples/broker.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/c/examples/broker.c b/c/examples/broker.c
index 2989ce393..6605582de 100644
--- a/c/examples/broker.c
+++ b/c/examples/broker.c
@@ -329,7 +329,12 @@ static bool handle(broker_t* b, pn_event_t* e, 
pn_connection_t *c) {
    }
    case PN_LINK_REMOTE_OPEN: {
      pn_link_t *l = pn_event_link(e);
-     if (pn_link_is_sender(l)) {
+     if (pn_terminus_get_type(pn_link_remote_target(l))==PN_COORDINATOR) {
+       pn_condition_t *error = pn_link_condition(l);
+       pn_condition_set_name(error, "amqp:not-implemented");
+       pn_link_close(l);
+       break;
+     } else if (pn_link_is_sender(l)) {
        const char *source = pn_terminus_get_address(pn_link_remote_source(l));
        pn_terminus_set_address(pn_link_source(l), source);
      } else {


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

Reply via email to