mirror of
https://github.com/nmap/nmap.git
synced 2025-12-18 13:39:02 +00:00
Made nsock messages more consistent.
- Always format function name without parens at the beginning of a message.
- Added a nsi_new notification message.
- Only trace the first call to nsi_delete() of a given IOD (i.e. don't log the
calls issued from the resulting callbacks).
This commit is contained in:
@@ -139,6 +139,10 @@ nsock_iod nsi_new2(nsock_pool nsockp, int sd, void *userdata) {
|
||||
|
||||
/* The nsp keeps track of active msiods so it can delete them if it is deleted */
|
||||
nsi->entry_in_nsp_active_iods = gh_list_append(&nsp->active_iods, nsi);
|
||||
|
||||
if (nsp->tracelevel > 1)
|
||||
nsock_trace(nsp, "nsi_new (IOD #%lu)", nsi->id);
|
||||
|
||||
return (nsock_iod)nsi;
|
||||
}
|
||||
|
||||
@@ -162,16 +166,15 @@ void nsi_delete(nsock_iod nsockiod, int pending_response) {
|
||||
|
||||
assert(nsi);
|
||||
|
||||
|
||||
if (nsi->nsp->tracelevel > 1)
|
||||
nsock_trace(nsi->nsp, "nsi_delete() (IOD #%lu)", nsi->id);
|
||||
|
||||
if (nsi->state == NSIOD_STATE_DELETED) {
|
||||
/* This nsi is already marked as deleted, will probably be removed from the
|
||||
* list very soon. Just return to avoid breaking reentrancy. */
|
||||
return;
|
||||
}
|
||||
|
||||
if (nsi->nsp->tracelevel > 1)
|
||||
nsock_trace(nsi->nsp, "nsi_delete (IOD #%lu)", nsi->id);
|
||||
|
||||
if (nsi->events_pending > 0) {
|
||||
/* shit -- they killed the msiod while an event was still pending on it.
|
||||
* Maybe I should store the pending events in the msiod. On the other hand,
|
||||
@@ -228,7 +231,7 @@ void nsi_delete(nsock_iod nsockiod, int pending_response) {
|
||||
if (SSL_shutdown(nsi->ssl) == -1) {
|
||||
|
||||
if (nsi->nsp->tracelevel > 1)
|
||||
nsock_trace(nsi->nsp, "nsi_delete(): SSL shutdown failed (%s) on NSI %li",
|
||||
nsock_trace(nsi->nsp, "nsi_delete: SSL shutdown failed (%s) on NSI %li",
|
||||
ERR_reason_error_string(SSL_get_error(nsi->ssl, -1)), nsi->id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user