qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject qpid-proton git commit: PROTON-988: Make pn_messenger_set_flags() work correctly
Date Mon, 15 Feb 2016 21:33:08 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master ca433506c -> f77163529


PROTON-988: Make pn_messenger_set_flags() work correctly


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/f7716352
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/f7716352
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/f7716352

Branch: refs/heads/master
Commit: f77163529d8b29d459ee8d1948b8ad829f63a545
Parents: ca43350
Author: Andrew Stitcher <astitcher@apache.org>
Authored: Mon Feb 15 16:03:34 2016 -0500
Committer: Andrew Stitcher <astitcher@apache.org>
Committed: Mon Feb 15 16:30:53 2016 -0500

----------------------------------------------------------------------
 proton-c/src/messenger/messenger.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f7716352/proton-c/src/messenger/messenger.c
----------------------------------------------------------------------
diff --git a/proton-c/src/messenger/messenger.c b/proton-c/src/messenger/messenger.c
index a376988..64be017 100644
--- a/proton-c/src/messenger/messenger.c
+++ b/proton-c/src/messenger/messenger.c
@@ -2357,9 +2357,13 @@ int pn_messenger_set_flags(pn_messenger_t *messenger, const int flags)
 {
   if (!messenger)
     return PN_ARG_ERR;
-  if (flags != 0 && (flags ^ PN_FLAGS_CHECK_ROUTES) != 0)
+  if (flags == 0) {
+    messenger->flags = 0;
+  } else if (flags & (PN_FLAGS_CHECK_ROUTES | PN_FLAGS_ALLOW_INSECURE_MECHS)) {
+    messenger->flags |= flags;
+  } else {
     return PN_ARG_ERR;
-  messenger->flags = flags;
+  }
   return 0;
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message