PROTON-334: Mark transport as authenticated on client side
- Make sure we don't send init SASL frames if an error happened


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

Branch: refs/heads/kgiusti-python3
Commit: 89ef63b46f35c6916f1e134a500fdf372bb5438d
Parents: cedb476
Author: Andrew Stitcher <astitc...@apache.org>
Authored: Wed Jun 3 11:06:37 2015 -0400
Committer: Andrew Stitcher <astitc...@apache.org>
Committed: Thu Jun 4 00:10:27 2015 -0400

----------------------------------------------------------------------
 proton-c/src/sasl/sasl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/89ef63b4/proton-c/src/sasl/sasl.c
----------------------------------------------------------------------
diff --git a/proton-c/src/sasl/sasl.c b/proton-c/src/sasl/sasl.c
index c425490..e180280 100644
--- a/proton-c/src/sasl/sasl.c
+++ b/proton-c/src/sasl/sasl.c
@@ -338,7 +338,7 @@ static void pni_post_sasl_frame(pn_transport_t *transport)
       pni_emit(transport);
       break;
     case SASL_RECVED_OUTCOME:
-      if (sasl->last_state < SASL_POSTED_INIT) {
+      if (sasl->last_state < SASL_POSTED_INIT && sasl->outcome==PN_SASL_OK) {
         desired_state = SASL_POSTED_INIT;
         continue;
       }
@@ -620,6 +620,7 @@ int pn_do_outcome(pn_transport_t *transport, uint8_t 
frame_type, uint16_t channe
 
   pni_sasl_t *sasl = transport->sasl;
   sasl->outcome = (pn_sasl_outcome_t) outcome;
+  transport->authenticated = sasl->outcome==PN_SASL_OK;
   pni_sasl_set_desired_state(transport, SASL_RECVED_OUTCOME);
 
   return 0;


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

Reply via email to