You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2019/11/26 18:19:37 UTC
[qpid-proton] branch master updated: PROTON-2138: properly parse
the remote terminus properties
This is an automated email from the ASF dual-hosted git repository.
kgiusti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
The following commit(s) were added to refs/heads/master by this push:
new 31eba2c PROTON-2138: properly parse the remote terminus properties
31eba2c is described below
commit 31eba2cab42efd81483fd6c7f2936ab8e20ff4ad
Author: Kenneth Giusti <kg...@apache.org>
AuthorDate: Wed Nov 20 11:33:28 2019 -0500
PROTON-2138: properly parse the remote terminus properties
The coordinator terminus only has a capabilities field. This is
different from the tranditional endpoint attach frame and must be
handled appropriately.
This closes #209
---
c/src/core/transport.c | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/c/src/core/transport.c b/c/src/core/transport.c
index ee00ad2..682a635 100644
--- a/c/src/core/transport.c
+++ b/c/src/core/transport.c
@@ -1396,9 +1396,7 @@ int pn_do_attach(pn_transport_t *transport, uint8_t frame_type, uint16_t channel
pn_terminus_set_dynamic(rtgt, tgt_dynamic);
} else {
uint64_t code = 0;
- pn_data_clear(link->remote_target.capabilities);
- err = pn_data_scan(args, "D.[.....D..DL[C]...]", &code,
- link->remote_target.capabilities);
+ err = pn_data_scan(args, "D.[.....D..DL....]", &code);
if (err) return err;
if (code == COORDINATOR) {
pn_terminus_set_type(rtgt, PN_COORDINATOR);
@@ -1418,22 +1416,35 @@ int pn_do_attach(pn_transport_t *transport, uint8_t frame_type, uint16_t channel
pn_data_clear(link->remote_source.filter);
pn_data_clear(link->remote_source.outcomes);
pn_data_clear(link->remote_source.capabilities);
- pn_data_clear(link->remote_target.properties);
- pn_data_clear(link->remote_target.capabilities);
- err = pn_data_scan(args, "D.[.....D.[.....C.C.CC]D.[.....CC]",
+ err = pn_data_scan(args, "D.[.....D.[.....C.C.CC]",
link->remote_source.properties,
link->remote_source.filter,
link->remote_source.outcomes,
- link->remote_source.capabilities,
- link->remote_target.properties,
- link->remote_target.capabilities);
+ link->remote_source.capabilities);
+
if (err) return err;
pn_data_rewind(link->remote_source.properties);
pn_data_rewind(link->remote_source.filter);
pn_data_rewind(link->remote_source.outcomes);
pn_data_rewind(link->remote_source.capabilities);
+
+ pn_data_clear(link->remote_target.properties);
+ pn_data_clear(link->remote_target.capabilities);
+
+ if (pn_terminus_get_type(&link->remote_target) == PN_COORDINATOR) {
+ // coordinator target only has a capabilities field
+ err = pn_data_scan(args, "D.[.....D..D.[C]...]",
+ link->remote_target.capabilities);
+ if (err) return err;
+ } else {
+ err = pn_data_scan(args, "D.[.....D..D.[.....CC]",
+ link->remote_target.properties,
+ link->remote_target.capabilities);
+ if (err) return err;
+ }
+
pn_data_rewind(link->remote_target.properties);
pn_data_rewind(link->remote_target.capabilities);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org