qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gmur...@apache.org
Subject qpid-dispatch git commit: DISPATCH-752 - If this connection is outbound and is just now opening, do the initial SSL/SASL setup
Date Thu, 27 Apr 2017 14:00:05 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/master a2a31e9e2 -> 361a7e9a6


DISPATCH-752 - If this connection is outbound and is just now opening, do the initial SSL/SASL
setup


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

Branch: refs/heads/master
Commit: 361a7e9a6b79039b378a36d18ba5d3e8d1f3aed9
Parents: a2a31e9
Author: Ganesh Murthy <gmurthy@redhat.com>
Authored: Thu Apr 27 09:59:50 2017 -0400
Committer: Ganesh Murthy <gmurthy@redhat.com>
Committed: Thu Apr 27 09:59:50 2017 -0400

----------------------------------------------------------------------
 src/server.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/361a7e9a/src/server.c
----------------------------------------------------------------------
diff --git a/src/server.c b/src/server.c
index ca13a8f..3875083 100644
--- a/src/server.c
+++ b/src/server.c
@@ -142,6 +142,8 @@ const char CERT_FINGERPRINT_SHA256 = '2';
 const char CERT_FINGERPRINT_SHA512 = '5';
 char *COMPONENT_SEPARATOR = ";";
 
+static void setup_ssl_sasl_and_open(qd_connection_t *ctx);
+
 static qd_thread_t *thread(qd_server_t *qd_server, int id)
 {
     qd_thread_t *thread = NEW(qd_thread_t);
@@ -774,6 +776,12 @@ static int process_connector(qd_server_t *qd_server, qdpn_connector_t
*cxtr)
         passes++;
 
         //
+        // If this connection is outbound and is just now opening, do the initial SSL/SASL
setup
+        //
+        if (!ctx->opened && !!ctx->connector && !qdpn_connector_closed(cxtr))
+            setup_ssl_sasl_and_open(ctx);
+
+        //
         // Step the engine for pre-handler processing
         //
         qdpn_connector_process(cxtr);
@@ -1197,7 +1205,7 @@ static void cxtr_try_open(void *context)
     //
     // Set up the transport, SASL, and SSL for the connection.
     //
-    pn_transport_t           *tport  = qdpn_connector_transport(ctx->pn_cxtr);
+    pn_transport_t *tport  = qdpn_connector_transport(ctx->pn_cxtr);
 
     //
     // Configure the transport
@@ -1216,6 +1224,16 @@ static void cxtr_try_open(void *context)
         pn_transport_set_tracer(tport, transport_tracer);
     }
 
+    ctx->owner_thread = CONTEXT_NO_OWNER;
+}
+
+
+static void setup_ssl_sasl_and_open(qd_connection_t *ctx)
+{
+    qd_connector_t *ct = ctx->connector;
+    const qd_server_config_t *config = ct->config;
+    pn_transport_t *tport  = qdpn_connector_transport(ctx->pn_cxtr);
+
     //
     // Set up SSL if appropriate
     //
@@ -1290,8 +1308,6 @@ static void cxtr_try_open(void *context)
     sys_mutex_unlock(ct->server->lock);
 
     pn_connection_open(ctx->pn_conn);
-
-    ctx->owner_thread = CONTEXT_NO_OWNER;
 }
 
 


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


Mime
View raw message