PROTON-859: Cyrus SASL pre 2.1.24 compatibility

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

Branch: refs/heads/kgiusti-python3
Commit: a79ca9a6aff0b5aee4ef55e5a33f49d64f2223e1
Parents: 74e16df
Author: Andrew Stitcher <[email protected]>
Authored: Wed Apr 22 15:44:31 2015 -0400
Committer: Andrew Stitcher <[email protected]>
Committed: Thu Apr 23 13:01:54 2015 -0400

----------------------------------------------------------------------
 proton-c/src/sasl/cyrus_sasl.c | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a79ca9a6/proton-c/src/sasl/cyrus_sasl.c
----------------------------------------------------------------------
diff --git a/proton-c/src/sasl/cyrus_sasl.c b/proton-c/src/sasl/cyrus_sasl.c
index 9e26517..8738507 100644
--- a/proton-c/src/sasl/cyrus_sasl.c
+++ b/proton-c/src/sasl/cyrus_sasl.c
@@ -28,6 +28,15 @@
 
 #include <sasl/sasl.h>
 
+// If the version of Cyrus SASL is too early for 
sasl_client_done()/sasl_server_done()
+// don't do any global clean up as it's not safe to use just sasl_done() for an
+// executable that uses both client and server parts of Cyrus SASL, because it 
can't
+// be called twice.
+#if SASL_VERSION_FULL<0x020118
+# define sasl_client_done()
+# define sasl_server_done()
+#endif
+
 enum pni_sasl_state {
   SASL_NONE,
   SASL_POSTED_INIT,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to