This is an automated email from the ASF dual-hosted git repository. chug pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/main by this push: new 9e87b89 DISPATCH-1878: Account for new dispositions used for flow control 9e87b89 is described below commit 9e87b8994d29cfba97789a246e5df20c4ac29cab Author: Chuck Rolke <c...@apache.org> AuthorDate: Tue Jun 8 10:48:12 2021 -0400 DISPATCH-1878: Account for new dispositions used for flow control Non-terminal RECEIVED dispositions used for TCP flow control generate new disposition states. This patch closes the TCP connection upon receiving RELEASED settlement and not on MODIFIED settlement. --- src/adaptors/tcp_adaptor.c | 11 +++++------ src/router_node.c | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/adaptors/tcp_adaptor.c b/src/adaptors/tcp_adaptor.c index 940d65f..c262088 100644 --- a/src/adaptors/tcp_adaptor.c +++ b/src/adaptors/tcp_adaptor.c @@ -1485,12 +1485,11 @@ static void qdr_tcp_delivery_update(void *context, qdr_delivery_t *dlv, uint64_t DLV_FMT" qdr_tcp_delivery_update: disp: %"PRIu64", settled: %s", DLV_ARGS(dlv), disp, settled ? "true" : "false"); - if (settled) { - // the only settlement occurs when the initial delivery is - // settled, which occurs when the connector is unable to - // connect to the configured tcp endpoint, so in this case - // we can just close the connection - // (The end of the message is used to convey half closed status) + if (settled && disp == PN_RELEASED) { + // When the connector is unable to connect to a tcp endpoint it will + // release the message. We handle that here by closing the connection. + // Half-closed status is signalled by read_eos_seen and is not + // sufficient by itself to force a connection closure. qd_log(tcp_adaptor->log_source, QD_LOG_DEBUG, DLV_FMT" qdr_tcp_delivery_update: call pn_raw_connection_close()", DLV_ARGS(dlv)); diff --git a/src/router_node.c b/src/router_node.c index 44f13cf..6df6679 100644 --- a/src/router_node.c +++ b/src/router_node.c @@ -2067,7 +2067,6 @@ static void CORE_delivery_update(void *context, qdr_delivery_t *dlv, uint64_t di if (disp && !pn_delivery_settled(pnd)) { uint64_t ignore = 0; qd_delivery_state_t *dstate = qdr_delivery_take_local_delivery_state(dlv, &ignore); - assert(ignore == disp); // expected: since both are from the same dlv // update if the disposition has changed or there is new state associated with it if (disp != pn_delivery_local_state(pnd) || dstate) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org