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/b912adbc Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/b912adbc Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/b912adbc Branch: refs/heads/0.9.x Commit: b912adbc6d793cd8fc30aa0b6d8b0499634d8cf4 Parents: 012fac5 Author: Gordon Sim <[email protected]> Authored: Fri Apr 17 11:41:10 2015 +0100 Committer: Robert Gemmell <[email protected]> Committed: Sat Apr 25 20:24:17 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/b912adbc/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]
