1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 06:01:28 +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

@@ -17,7 +17,7 @@ static int basic_setup(void **tdata) {
if (btd == NULL)
return -ENOMEM;
btd->nsp = nsp_new(NULL);
btd->nsp = nsock_pool_new(NULL);
*tdata = btd;
return 0;
@@ -27,7 +27,7 @@ static int basic_teardown(void *tdata) {
struct basic_test_data *btd = (struct basic_test_data *)tdata;
if (tdata) {
nsp_delete(btd->nsp);
nsock_pool_delete(btd->nsp);
free(tdata);
}
return 0;
@@ -36,9 +36,9 @@ static int basic_teardown(void *tdata) {
static int basic_udata(void *tdata) {
struct basic_test_data *btd = (struct basic_test_data *)tdata;
AssertEqual(nsp_getud(btd->nsp), NULL);
nsp_setud(btd->nsp, btd);
AssertEqual(nsp_getud(btd->nsp), btd);
AssertEqual(nsock_pool_get_udata(btd->nsp), NULL);
nsock_pool_set_udata(btd->nsp, btd);
AssertEqual(nsock_pool_get_udata(btd->nsp), btd);
return 0;
}