PROTON-850: ensure attach updates correct link object (cherry picked from commit fd26ec66bcd1fda328ceca119efc43bf787e0bcf)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/1324d972 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/1324d972 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/1324d972 Branch: refs/heads/0.9.x Commit: 1324d972f28c721a73e217ab9630d2c208e74b07 Parents: 69fc2eb Author: Gordon Sim <[email protected]> Authored: Fri Apr 17 11:41:10 2015 +0100 Committer: Robert Gemmell <[email protected]> Committed: Fri Apr 24 15:48:41 2015 +0100 ---------------------------------------------------------------------- proton-c/src/transport/transport.c | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1324d972/proton-c/src/transport/transport.c ---------------------------------------------------------------------- diff --git a/proton-c/src/transport/transport.c b/proton-c/src/transport/transport.c index 8b36389..10ac8fb 100644 --- a/proton-c/src/transport/transport.c +++ b/proton-c/src/transport/transport.c @@ -1078,6 +1078,11 @@ pn_link_t *pn_find_link(pn_session_t *ssn, pn_bytes_t name, bool is_sender) { pn_link_t *link = (pn_link_t *) pn_list_get(ssn->links, i); if (link->endpoint.type == type && + // This function is used to locate the link object for an + // incoming attach. If a link object of the same name is found + // which is closed both locally and remotely, assume that is + // no longer in use. + !((link->endpoint.state & PN_LOCAL_CLOSED) && (link->endpoint.state & PN_REMOTE_CLOSED)) && !strncmp(name.start, pn_string_get(link->name), name.size)) { return link; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
