From 54db24fcb39c4e39f122d3069680eb20e93a3ac5 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Wed, 29 May 2024 14:32:30 -0400 Subject: [PATCH] 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 {