1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-17 05:09:00 +00:00

Don't associate nsock logging info to a nspool.

Make current loglevel and current log callback global
to the library. Attaching them to the nsock pool doesn't
bring any benefit and prevents from logging activity in
code sections that don't have access to a pool (such as
proxy chain specification parsing).

Updated external calls and nsock tests accordingly.
This commit is contained in:
henri
2015-06-27 08:21:53 +00:00
parent b75233ce98
commit b55ff2d68f
34 changed files with 222 additions and 209 deletions

View File

@@ -75,7 +75,7 @@ nsock_event_id nsock_readlines(nsock_pool nsp, nsock_iod ms_iod,
nse = event_new(ms, NSE_TYPE_READ, nsi, timeout_msecs, handler, userdata);
assert(nse);
nsock_log_info(ms, "Read request for %d lines from IOD #%li [%s] EID %li",
nsock_log_info("Read request for %d lines from IOD #%li [%s] EID %li",
nlines, nsi->id, get_peeraddr_string(nsi), nse->id);
nse->readinfo.read_type = NSOCK_READLINES;
@@ -98,7 +98,7 @@ nsock_event_id nsock_readbytes(nsock_pool nsp, nsock_iod ms_iod,
nse = event_new(ms, NSE_TYPE_READ, nsi, timeout_msecs, handler, userdata);
assert(nse);
nsock_log_info(ms, "Read request for %d bytes from IOD #%li [%s] EID %li",
nsock_log_info("Read request for %d bytes from IOD #%li [%s] EID %li",
nbytes, nsi->id, get_peeraddr_string(nsi), nse->id);
nse->readinfo.read_type = NSOCK_READBYTES;
@@ -122,7 +122,7 @@ nsock_event_id nsock_read(nsock_pool nsp, nsock_iod ms_iod,
nse = event_new(ms, NSE_TYPE_READ, nsi, timeout_msecs, handler, userdata);
assert(nse);
nsock_log_info(ms, "Read request from IOD #%li [%s] (timeout: %dms) EID %li",
nsock_log_info("Read request from IOD #%li [%s] (timeout: %dms) EID %li",
nsi->id, get_peeraddr_string(nsi), timeout_msecs, nse->id);
nse->readinfo.read_type = NSOCK_READ;