Skip to content

Commit

Permalink
PROTON-2824: [C example beoker] Reject attempts to use transactions
Browse files Browse the repository at this point in the history
Close the link with an error if the client tries to attach to a
tnasactions coordinator terminus.
  • Loading branch information
astitcher committed May 29, 2024
1 parent 36fe831 commit 54db24f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion c/examples/broker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 54db24f

Please sign in to comment.