You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2018/03/15 22:28:38 UTC
qpid-proton git commit: NO-JIRA: [C++ binding] Fix broken change to
simple_connect
Repository: qpid-proton
Updated Branches:
refs/heads/master edf5d5b82 -> 9ca7f40a1
NO-JIRA: [C++ binding] Fix broken change to simple_connect
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/9ca7f40a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/9ca7f40a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/9ca7f40a
Branch: refs/heads/master
Commit: 9ca7f40a13afa1f6276ab1e8ec18c2b8af7e8d2d
Parents: edf5d5b
Author: Andrew Stitcher <as...@apache.org>
Authored: Thu Mar 15 18:27:54 2018 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu Mar 15 18:27:54 2018 -0400
----------------------------------------------------------------------
examples/cpp/simple_connect.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9ca7f40a/examples/cpp/simple_connect.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/simple_connect.cpp b/examples/cpp/simple_connect.cpp
index 0085b3b..b0d51c2 100644
--- a/examples/cpp/simple_connect.cpp
+++ b/examples/cpp/simple_connect.cpp
@@ -49,8 +49,16 @@ class simple_connect : public proton::messaging_handler {
if (!user.empty()) co.user(user);
if (!password.empty()) co.password(password);
if (sasl) co.sasl_enabled(true);
+ //
+ // NB: We only set sasl options if they are not default to avoid
+ // forcing SASL negotiation on when it's not needed.
+ //
+ // This is because the SASL negotiation is turned off unless
+ // it is needed. Setting a username/password or any SASL option will
+ // force the SASL negotiation to be turned on.
+ //
if (!mechs.empty()) co.sasl_allowed_mechs(mechs);
- co.sasl_allow_insecure_mechs(insecure);
+ if (insecure) co.sasl_allow_insecure_mechs(true);
connection = c.connect(url, co);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org