1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-22 23:49:03 +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

@@ -32,7 +32,7 @@ static void timer_handler(nsock_pool nsp, nsock_event nse, void *tdata) {
int rnd, rnd2;
if (nse_status(nse) != NSE_STATUS_SUCCESS) {
ttd->stop = -nsp_geterrorcode(nsp);
ttd->stop = -nsock_pool_get_error(nsp);
return;
}
@@ -74,7 +74,7 @@ static int timer_setup(void **tdata) {
if (ttd == NULL)
return -ENOMEM;
ttd->nsp = nsp_new(NULL);
ttd->nsp = nsock_pool_new(NULL);
AssertNonNull(ttd->nsp);
*tdata = ttd;
@@ -85,7 +85,7 @@ static int timer_teardown(void *tdata) {
struct timer_test_data *ttd = (struct timer_test_data *)tdata;
if (tdata) {
nsp_delete(ttd->nsp);
nsock_pool_delete(ttd->nsp);
free(tdata);
}
return 0;
@@ -114,7 +114,7 @@ static int timer_totalmess(void *tdata) {
return 0;
default:
return -(nsp_geterrorcode(ttd->nsp));
return -(nsock_pool_get_error(ttd->nsp));
}
}
return ttd->stop;