qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [4/4] qpid-dispatch git commit: DISPATCH-390: Move move declarations from server_private.h to server.c
Date Thu, 19 Jan 2017 21:17:46 GMT
DISPATCH-390: Move move declarations from server_private.h to server.c

Move unnecessarily public declarations from server_private.h to server.c


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

Branch: refs/heads/master
Commit: 9b8f0efe9b0cd8278de1a66413da9b14c4ebf0a2
Parents: f82944b
Author: Alan Conway <aconway@redhat.com>
Authored: Thu Jan 19 15:59:14 2017 -0500
Committer: Alan Conway <aconway@redhat.com>
Committed: Thu Jan 19 15:59:14 2017 -0500

----------------------------------------------------------------------
 include/qpid/dispatch/server.h |  1 +
 src/connection_manager.c       |  2 +-
 src/http-libwebsockets.c       |  2 +-
 src/router_node.c              |  4 ++--
 src/server.c                   | 39 +++++++++++++++++++++++++++++++++++++
 src/server_private.h           | 33 +++++++++----------------------
 6 files changed, 53 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/9b8f0efe/include/qpid/dispatch/server.h
----------------------------------------------------------------------
diff --git a/include/qpid/dispatch/server.h b/include/qpid/dispatch/server.h
index 0562222..dd868a6 100644
--- a/include/qpid/dispatch/server.h
+++ b/include/qpid/dispatch/server.h
@@ -603,6 +603,7 @@ pn_connection_t *qd_connection_pn(qd_connection_t *conn);
 bool qd_connection_inbound(qd_connection_t *conn);
 
 
+/* FIXME aconway 2017-01-19: hide for batching */
 /**
  * Get the event collector for a connection.
  *

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/9b8f0efe/src/connection_manager.c
----------------------------------------------------------------------
diff --git a/src/connection_manager.c b/src/connection_manager.c
index 70ebe6d..c785dea 100644
--- a/src/connection_manager.c
+++ b/src/connection_manager.c
@@ -499,7 +499,7 @@ void qd_connection_manager_start(qd_dispatch_t *qd)
         if (cl->listener == 0 )
             if (cl->state == QD_BIND_NONE) { //Try to start listening only if we have
never tried to listen on that port before
                 cl->listener = qd_server_listen(qd, &cl->configuration, cl);
-                if (cl->listener && cl->listener->pn_listener)
+                if (cl->listener)
                     cl->state = QD_BIND_SUCCESSFUL;
                 else {
                     cl->state = QD_BIND_FAILED;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/9b8f0efe/src/http-libwebsockets.c
----------------------------------------------------------------------
diff --git a/src/http-libwebsockets.c b/src/http-libwebsockets.c
index 798851a..9ceaa49 100644
--- a/src/http-libwebsockets.c
+++ b/src/http-libwebsockets.c
@@ -265,7 +265,7 @@ static void check_timer(void *void_http_server) {
 
 static qd_http_listener_t * qdpn_connector_http_listener(qdpn_connector_t* c) {
     qd_listener_t* ql = (qd_listener_t*)qdpn_listener_context(qdpn_connector_listener(c));
-    return ql->http;
+    return qd_listener_http(ql);
 }
 
 static void http_connector_process(qdpn_connector_t *c) {

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/9b8f0efe/src/router_node.c
----------------------------------------------------------------------
diff --git a/src/router_node.c b/src/router_node.c
index fa466a6..d3baf8e 100644
--- a/src/router_node.c
+++ b/src/router_node.c
@@ -622,9 +622,9 @@ static void AMQP_opened_handler(qd_router_t *router, qd_connection_t *conn,
bool
     const char *host = 0;
 
     const qd_server_config_t *config;
-    if (conn->connector) {
+    if (qd_connection_connector(conn)) {
         char host_local[255];
-        config = conn->connector->config;
+        config = qd_connector_config(qd_connection_connector(conn));
         snprintf(host_local, strlen(config->host)+strlen(config->port)+2, "%s:%s",
config->host, config->port);
         host = &host_local[0];
     }

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/9b8f0efe/src/server.c
----------------------------------------------------------------------
diff --git a/src/server.c b/src/server.c
index 7da9f23..4ba100c 100644
--- a/src/server.c
+++ b/src/server.c
@@ -92,6 +92,33 @@ struct qd_server_t {
     qd_http_server_t         *http;
 };
 
+/**
+ * Listener objects represent the desire to accept incoming transport connections.
+ */
+struct qd_listener_t {
+    qd_server_t              *server;
+    const qd_server_config_t *config;
+    void                     *context;
+    qdpn_listener_t          *pn_listener;
+    qd_http_listener_t       *http;
+};
+
+
+/**
+ * Connector objects represent the desire to create and maintain an outgoing transport connection.
+ */
+struct qd_connector_t {
+    qd_server_t              *server;
+    cxtr_state_t              state;
+    const qd_server_config_t *config;
+    void                     *context;
+    qd_connection_t          *ctx;
+    qd_timer_t               *timer;
+    long                      delay;
+};
+
+
+
 static __thread qd_server_t *thread_server = 0;
 
 #define HEARTBEAT_INTERVAL 1000
@@ -1709,3 +1736,15 @@ const char* qd_connection_name(const qd_connection_t *c) {
 const char* qd_connection_hostip(const qd_connection_t *c) {
     return qdpn_connector_hostip(c->pn_cxtr);
 }
+
+qd_connector_t* qd_connection_connector(const qd_connection_t *c) {
+    return c->connector;
+}
+
+const qd_server_config_t *qd_connector_config(const qd_connector_t *c) {
+    return c->config;
+}
+
+qd_http_listener_t *qd_listener_http(qd_listener_t *l) {
+    return l->http;
+}

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/9b8f0efe/src/server_private.h
----------------------------------------------------------------------
diff --git a/src/server_private.h b/src/server_private.h
index 896128d..576b5ec 100644
--- a/src/server_private.h
+++ b/src/server_private.h
@@ -34,9 +34,18 @@
 
 void qd_server_timer_pending_LH(qd_timer_t *timer);
 void qd_server_timer_cancel_LH(qd_timer_t *timer);
+
+/* FIXME aconway 2017-01-19: to include/server.h? */
+
 struct qd_dispatch_t* qd_server_dispatch(qd_server_t *server);
+
 const char* qd_connection_name(const qd_connection_t *c);
 const char* qd_connection_hostip(const qd_connection_t *c);
+qd_connector_t* qd_connection_connector(const qd_connection_t *c);
+
+const qd_server_config_t *qd_connector_config(const qd_connector_t *c);
+
+qd_http_listener_t *qd_listener_http(qd_listener_t *l);
 
 #define CONTEXT_NO_OWNER -1
 #define CONTEXT_UNSPECIFIED_OWNER -2
@@ -54,30 +63,6 @@ typedef enum {
 } cxtr_state_t;
 
 
-/**
- * Listener objects represent the desire to accept incoming transport connections.
- */
-struct qd_listener_t {
-    qd_server_t              *server;
-    const qd_server_config_t *config;
-    void                     *context;
-    qdpn_listener_t          *pn_listener;
-    qd_http_listener_t       *http;
-};
-
-
-/**
- * Connector objects represent the desire to create and maintain an outgoing transport connection.
- */
-struct qd_connector_t {
-    qd_server_t              *server;
-    cxtr_state_t              state;
-    const qd_server_config_t *config;
-    void                     *context;
-    qd_connection_t          *ctx;
-    qd_timer_t               *timer;
-    long                      delay;
-};
 
 
 typedef struct qd_deferred_call_t {


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


Mime
View raw message