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: NO-JIRA: Small tidy up
Date Thu, 02 Jul 2015 18:21:05 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master 5638c5a86 -> 7e3190306


NO-JIRA: Small tidy up


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

Branch: refs/heads/master
Commit: 7e3190306999da2d0d958a309d4105fddfb004f4
Parents: 5638c5a
Author: Andrew Stitcher <astitcher@apache.org>
Authored: Thu Jul 2 14:20:22 2015 -0400
Committer: Andrew Stitcher <astitcher@apache.org>
Committed: Thu Jul 2 14:20:22 2015 -0400

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


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7e319030/proton-c/src/sasl/sasl.c
----------------------------------------------------------------------
diff --git a/proton-c/src/sasl/sasl.c b/proton-c/src/sasl/sasl.c
index a33256c..a436674 100644
--- a/proton-c/src/sasl/sasl.c
+++ b/proton-c/src/sasl/sasl.c
@@ -279,8 +279,7 @@ static ssize_t pn_input_read_sasl(pn_transport_t* transport, unsigned
int layer,
 
   pni_sasl_start_server_if_needed(transport);
 
-  bool dummy = false;
-  ssize_t n = pn_dispatcher_input(transport, bytes, available, false, &dummy);
+  ssize_t n = pn_dispatcher_input(transport, bytes, available, false, &transport->halt);
 
   if (n!=0 || !pni_sasl_is_final_input_state(transport->sasl)) {
     return n;
@@ -288,14 +287,15 @@ static ssize_t pn_input_read_sasl(pn_transport_t* transport, unsigned
int layer,
 
   pni_sasl_t *sasl = transport->sasl;
   if (pni_sasl_impl_can_encrypt(transport)) {
-    transport->io_layers[layer] = &sasl_encrypt_layer;
     sasl->max_encrypt_size = pni_sasl_impl_max_encrypt_size(transport);
     pn_transport_logf(transport, "SASL max buffer: %d", sasl->max_encrypt_size);
-    return transport->io_layers[layer]->process_input(transport, layer, bytes, available);
+    transport->io_layers[layer] = &sasl_encrypt_layer;
   } else if (sasl->client) {
     transport->io_layers[layer] = &pni_passthru_layer;
+  } else {
+    return pni_passthru_layer.process_input(transport, layer, bytes, available );
   }
-  return pni_passthru_layer.process_input(transport, layer, bytes, available );
+  return transport->io_layers[layer]->process_input(transport, layer, bytes, available);
 }
 
 static ssize_t pn_input_read_sasl_encrypt(pn_transport_t* transport, unsigned int layer,
const char* bytes, size_t available)
@@ -360,14 +360,15 @@ static ssize_t pn_output_write_sasl(pn_transport_t* transport, unsigned
int laye
   }
 
   if (pni_sasl_impl_can_encrypt(transport)) {
-    transport->io_layers[layer] = &sasl_encrypt_layer;
     sasl->max_encrypt_size = pni_sasl_impl_max_encrypt_size(transport);
     pn_transport_logf(transport, "SASL max buffer: %d", sasl->max_encrypt_size);
-    return transport->io_layers[layer]->process_output(transport, layer, bytes, available);
-  } else if (!sasl->client) {
+    transport->io_layers[layer] = &sasl_encrypt_layer;
+  } else if (sasl->client) {
+    return pni_passthru_layer.process_output(transport, layer, bytes, available );
+  } else {
     transport->io_layers[layer] = &pni_passthru_layer;
   }
-  return pni_passthru_layer.process_output(transport, layer, bytes, available );
+  return transport->io_layers[layer]->process_output(transport, layer, bytes, available);
 }
 
 static ssize_t pn_output_write_sasl_encrypt(pn_transport_t* transport, unsigned int layer,
char* bytes, size_t available)


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


Mime
View raw message