qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject [01/14] qpid-dispatch git commit: DISPATCH-760: accessor for connection status: interrouter vs user
Date Fri, 07 Jul 2017 20:39:38 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 0e62bd820 -> 50637b770


DISPATCH-760: accessor for connection status: interrouter vs user


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

Branch: refs/heads/master
Commit: 1c3b0dd6f2e64718242c3da152ae56312ab2d365
Parents: 0e62bd8
Author: Chuck Rolke <crolke@redhat.com>
Authored: Fri Jun 30 11:04:17 2017 -0400
Committer: Chuck Rolke <crolke@redhat.com>
Committed: Fri Jul 7 10:37:59 2017 -0400

----------------------------------------------------------------------
 include/qpid/dispatch/server.h | 5 +++++
 src/router_node.c              | 3 +++
 src/server.c                   | 4 ++++
 src/server_private.h           | 1 +
 4 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/1c3b0dd6/include/qpid/dispatch/server.h
----------------------------------------------------------------------
diff --git a/include/qpid/dispatch/server.h b/include/qpid/dispatch/server.h
index eb5214b..98834fe 100644
--- a/include/qpid/dispatch/server.h
+++ b/include/qpid/dispatch/server.h
@@ -530,6 +530,11 @@ const char* qd_connection_name(const qd_connection_t *c);
 const char* qd_connection_remote_ip(const qd_connection_t *c);
 
 /**
+ * Get inter-router vs user connection status
+ */
+bool qd_connection_is_interrouter(const qd_connection_t *c);
+
+/**
  * @}
  */
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/1c3b0dd6/src/router_node.c
----------------------------------------------------------------------
diff --git a/src/router_node.c b/src/router_node.c
index ca7d746..ae30831 100644
--- a/src/router_node.c
+++ b/src/router_node.c
@@ -664,6 +664,9 @@ static void AMQP_opened_handler(qd_router_t *router, qd_connection_t *conn,
bool
     pn_data_t *props = pn_conn ? pn_connection_remote_properties(pn_conn) : 0;
 
     if (role == QDR_ROLE_INTER_ROUTER) {
+
+        conn->interrouter = true;
+
         //
         // Check the remote properties for an inter-router cost value.
         //

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/1c3b0dd6/src/server.c
----------------------------------------------------------------------
diff --git a/src/server.c b/src/server.c
index 792e03e..5d3544a 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1257,3 +1257,7 @@ const char* qd_connection_remote_ip(const qd_connection_t *c) {
 void qd_connection_handle(qd_connection_t *c, pn_event_t *e) {
     handle(c->server, e);
 }
+
+bool qd_connection_is_interrouter(const qd_connection_t* c) {
+    return c->interrouter;
+}

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/1c3b0dd6/src/server_private.h
----------------------------------------------------------------------
diff --git a/src/server_private.h b/src/server_private.h
index 77adf32..08dd3af 100644
--- a/src/server_private.h
+++ b/src/server_private.h
@@ -154,6 +154,7 @@ struct qd_connection_t {
     sys_mutex_t              *deferred_call_lock;
     bool                      policy_counted;
     char                     *role;  //The specified role of the connection, e.g. "normal",
"inter-router", "route-container" etc.
+    bool                      interrouter; // true when *role == "inter-router"
     void (*wake)(qd_connection_t*); /* Wake method, different for HTTP vs. proactor */
     char rhost[NI_MAXHOST];     /* Remote host numeric IP for incoming connections */
     char rhost_port[NI_MAXHOST+NI_MAXSERV]; /* Remote host:port for incoming connections
*/


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


Mime
View raw message