[prev in list] [next in list] [prev in thread] [next in thread]
List: rsync-cvs
Subject: [SCM] The rsync repository. - branch b3.0.x updated
From: Rsync CVS commit messages <rsync-cvs () lists ! samba ! org>
Date: 2011-07-16 23:18:03
Message-ID: mailman.36.1310858240.1392.rsync-cvs () lists ! samba ! org
[Download RAW message or body]
The branch, b3.0.x has been updated
via c0d07c0 Replace another inet_ntop() call with getnameinfo().
from 606c603 Add more connect debug info, as Carlos suggested.
;a=shortlog;h=b3.0.x
- Log -----------------------------------------------------------------
commit c0d07c098724ee8c382a498cab991f7d8467d778
Author: Wayne Davison <wayned@samba.org>
Date: Sat Jul 16 15:42:32 2011 -0700
Replace another inet_ntop() call with getnameinfo().
-----------------------------------------------------------------------
Summary of changes:
clientserver.c | 2 +-
socket.c | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
Changeset truncated at 500 lines:
diff --git a/clientserver.c b/clientserver.c
index 038900e..f3e2c04 100644
--- a/clientserver.c
+++ b/clientserver.c
@@ -1071,7 +1071,7 @@ int daemon_main(void)
rprintf(FLOG, "rsyncd version %s starting, listening on port %d\n",
RSYNC_VERSION, rsync_port);
/* TODO: If listening on a particular address, then show that
- * address too. In fact, why not just do inet_ntop on the
+ * address too. In fact, why not just do getnameinfo on the
* local address??? */
start_accept_loop(rsync_port, start_daemon);
diff --git a/socket.c b/socket.c
index 855fc09..dc9e325 100644
--- a/socket.c
+++ b/socket.c
@@ -300,9 +300,8 @@ int open_socket_out(char *host, int port, const char *bind_addr,
if (verbose >= 3) {
char buf[2048];
if ((error = getnameinfo(res->ai_addr, res->ai_addrlen, buf, sizeof buf, NULL, 0, \
NI_NUMERICHOST) != 0))
- rprintf(FINFO, "error in getnameinfo: %s\n", gai_strerror(error));
- else
- rprintf(FINFO, "Connected to %s (%s)\n", h, buf);
+ snprintf(buf, sizeof buf, "*getnameinfo failure: %s*", gai_strerror(error));
+ rprintf(FINFO, "Connected to %s (%s)\n", h, buf);
}
break;
}
@@ -312,8 +311,8 @@ int open_socket_out(char *host, int port, const char *bind_addr,
for (res = res0, j = 0; res; res = res->ai_next, j++) {
if (errnos[j] == 0)
continue;
- if (inet_ntop(res->ai_family, res->ai_addr->sa_data + 2, buf, sizeof buf) == \
NULL)
- strlcpy(buf, "*inet_ntop failed*", sizeof buf);
+ if ((error = getnameinfo(res->ai_addr, res->ai_addrlen, buf, sizeof buf, NULL, 0, \
NI_NUMERICHOST) != 0)) + snprintf(buf, sizeof buf, "*getnameinfo failure: %s*", \
gai_strerror(error)); rsyserr(FERROR, errnos[j], "failed to connect to %s (%s)", h, \
buf); }
if (s < 0)
--
The rsync repository.
_______________________________________________
rsync-cvs mailing list
rsync-cvs@lists.samba.org
https://lists.samba.org/mailman/listinfo/rsync-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic