1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-19 05:59:01 +00:00

Refactor get_hostaddr_string to get_peeraddr_string.

All the information passed as arguments is present in an iod, and we
only call this with members of one iod. Change it to accept just an iod
as an argument.
This commit is contained in:
david
2012-11-12 20:44:49 +00:00
parent f5ac3e9f4e
commit 7b371609a3
5 changed files with 33 additions and 38 deletions

View File

@@ -56,6 +56,7 @@
/* $Id$ */
#include "nsock_internal.h"
#include "netutils.h"
/* Read up to nlines lines (terminated with \n, which of course includes \r\n),
@@ -75,7 +76,7 @@ nsock_event_id nsock_readlines(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handle
if (ms->tracelevel > 0) {
if (nsi->peerlen > 0)
nsock_trace(ms, "Read request for %d lines from IOD #%li [%s] EID %li",
nlines, nsi->id, get_hostaddr_string(&nsi->peer, nsi->peerlen, (unsigned short)nsi_peerport(nsi)),
nlines, nsi->id, get_peeraddr_string(nsi),
nse->id);
else
nsock_trace(ms, "Read request for %d lines from IOD #%li (peer unspecified) EID %li",
@@ -104,7 +105,7 @@ nsock_event_id nsock_readbytes(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handle
if (ms->tracelevel > 0) {
if (nsi->peerlen > 0)
nsock_trace(ms, "Read request for %d bytes from IOD #%li [%s] EID %li",
nbytes, nsi->id, get_hostaddr_string(&nsi->peer, nsi->peerlen, (unsigned short)nsi_peerport(nsi)),
nbytes, nsi->id, get_peeraddr_string(nsi),
nse->id);
else
nsock_trace(ms, "Read request for %d bytes from IOD #%li (peer unspecified) EID %li",
@@ -133,7 +134,7 @@ nsock_event_id nsock_read(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handler han
if (ms->tracelevel > 0) {
if (nsi->peerlen > 0)
nsock_trace(ms, "Read request from IOD #%li [%s] (timeout: %dms) EID %li",
nsi->id, get_hostaddr_string(&nsi->peer, nsi->peerlen, (unsigned short)nsi_peerport(nsi)),
nsi->id, get_peeraddr_string(nsi),
timeout_msecs, nse->id);
else
nsock_trace(ms, "Read request from IOD #%li (peer unspecified) (timeout: %dms) EID %li",