qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject qpid-dispatch git commit: DISPATCH-390: Update server.c for change in PROTON-1470
Date Mon, 01 May 2017 13:22:19 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/master a00781c01 -> d9de2ba3f


DISPATCH-390: Update server.c for change in PROTON-1470


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

Branch: refs/heads/master
Commit: d9de2ba3f2e2d03df7c4c4cfbf63c93c285e415b
Parents: a00781c
Author: Alan Conway <aconway@redhat.com>
Authored: Mon May 1 09:19:49 2017 -0400
Committer: Alan Conway <aconway@redhat.com>
Committed: Mon May 1 09:21:52 2017 -0400

----------------------------------------------------------------------
 src/server.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/d9de2ba3/src/server.c
----------------------------------------------------------------------
diff --git a/src/server.c b/src/server.c
index 52651d1..a3fbe40 100644
--- a/src/server.c
+++ b/src/server.c
@@ -27,6 +27,7 @@
 
 #include <proton/event.h>
 #include <proton/listener.h>
+#include <proton/netaddr.h>
 #include <proton/proactor.h>
 #include <proton/sasl.h>
 
@@ -556,11 +557,11 @@ void connect_fail(qd_connection_t *ctx, const char *name, const char
*descriptio
 /* Get the host IP address for the remote end */
 static void set_rhost_port(qd_connection_t *ctx) {
     pn_transport_t *tport  = pn_connection_transport(ctx->pn_conn);
-    const struct sockaddr_storage* addr =
-        pn_proactor_addr_sockaddr(pn_proactor_addr_remote(tport));
-    if (addr) {
+    struct sockaddr* sa = pn_netaddr_sockaddr(pn_netaddr_remote(tport));
+    size_t salen = pn_netaddr_socklen(pn_netaddr_remote(tport));
+    if (sa && salen) {
         char rport[NI_MAXSERV] = "";
-        int err = getnameinfo((struct sockaddr*)addr, sizeof(*addr),
+        int err = getnameinfo(sa, salen,
                               ctx->rhost, sizeof(ctx->rhost), rport, sizeof(rport),
                               NI_NUMERICHOST | NI_NUMERICSERV);
         if (!err) {


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


Mime
View raw message