mirror of
https://github.com/nmap/nmap.git
synced 2025-12-12 10:49:02 +00:00
Merged nsock-logging from nmap-exp/henri/nsock-logging/
Reworked the logging infrastructure to make it more flexible and consistent. Updated nmap, nping and ncat accordingly. Nsock log level can now be adjusted at runtime by pressing d/D in nmap.
This commit is contained in:
@@ -67,6 +67,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "nsock_internal.h"
|
||||
#include "nsock_log.h"
|
||||
|
||||
#if HAVE_PCAP
|
||||
#include "nsock_pcap.h"
|
||||
@@ -236,8 +237,7 @@ int kqueue_loop(mspool *nsp, int msec_timeout) {
|
||||
}
|
||||
|
||||
do {
|
||||
if (nsp->tracelevel > 6)
|
||||
nsock_trace(nsp, "wait_for_events");
|
||||
nsock_log_debug_all(nsp, "wait_for_events");
|
||||
|
||||
if (nsp->next_ev.tv_sec == 0)
|
||||
event_msecs = -1; /* None of the events specified a timeout */
|
||||
@@ -287,7 +287,7 @@ int kqueue_loop(mspool *nsp, int msec_timeout) {
|
||||
} while (results_left == -1 && sock_err == EINTR); /* repeat only if signal occurred */
|
||||
|
||||
if (results_left == -1 && sock_err != EINTR) {
|
||||
nsock_trace(nsp, "nsock_loop error %d: %s", sock_err, socket_strerror(sock_err));
|
||||
nsock_log_error(nsp, "nsock_loop error %d: %s", sock_err, socket_strerror(sock_err));
|
||||
nsp->errnum = sock_err;
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user