diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2006-08-01 00:22:00 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2006-08-01 00:22:00 +0000 |
commit | 0e39c71c356b5f109f79afc1c3fa1fc47084b014 (patch) | |
tree | d99a21ecd216fd527634643cdde04824f6ee0e1b | |
parent | 3043f194879fa7fe42736df9523a67088deed806 (diff) | |
download | fetchmail-0e39c71c356b5f109f79afc1c3fa1fc47084b014.tar.gz fetchmail-0e39c71c356b5f109f79afc1c3fa1fc47084b014.tar.bz2 fetchmail-0e39c71c356b5f109f79afc1c3fa1fc47084b014.zip |
When trying to connect or upon connection failure, log the numeric service port, too.
svn path=/branches/BRANCH_6-3/; revision=4875
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | socket.c | 9 |
2 files changed, 8 insertions, 4 deletions
@@ -97,7 +97,8 @@ fetchmail 6.3.5 (not yet released): documented behavior. SIGUSR1 has always been a wakeup signal for both root (undocumented) and non-root users. See also the deprecation warning above. * When a connection fails, log not only the IP address, but also host and - service name. + service name and the port number. Log the latter when trying to connect in + verbose mode, too. * Keep syslog output at one line per message (this works if no errors occur). # CHANGES: @@ -287,15 +287,18 @@ int SockOpen(const char *host, const char *service, i = -1; for (ai = ai0; ai; ai = ai->ai_next) { - char buf[80]; + char buf[80],pb[80]; int gnie; gnie = getnameinfo(ai->ai_addr, ai->ai_addrlen, buf, sizeof(buf), NULL, 0, NI_NUMERICHOST); if (gnie) snprintf(buf, sizeof(buf), GT_("unknown (%s)"), gai_strerror(gnie)); + gnie = getnameinfo(ai->ai_addr, ai->ai_addrlen, NULL, 0, pb, sizeof(pb), NI_NUMERICSERV); + if (gnie) + snprintf(pb, sizeof(pb), GT_("unknown (%s)"), gai_strerror(gnie)); if (outlevel >= O_VERBOSE) - report_build(stdout, GT_("Trying to connect to %s..."), buf); + report_build(stdout, GT_("Trying to connect to %s/%s..."), buf, pb); i = socket(ai->ai_family, ai->ai_socktype, 0); if (i < 0) { /* mask EAFNOSUPPORT errors, they confuse users for @@ -321,7 +324,7 @@ int SockOpen(const char *host, const char *service, if (outlevel >= O_VERBOSE) report_complete(stdout, GT_("connection failed.\n")); if (outlevel > O_SILENT) - report(stderr, GT_("connection to %s:%s [%s] failed: %s.\n"), host, service, buf, strerror(e)); + report(stderr, GT_("connection to %s:%s [%s/%s] failed: %s.\n"), host, service, buf, pb, strerror(e)); fm_close(i); i = -1; continue; |