diff --git a/nsock/src/nsock_event.c b/nsock/src/nsock_event.c index 62c7a5a68..1018ac945 100644 --- a/nsock/src/nsock_event.c +++ b/nsock/src/nsock_event.c @@ -258,7 +258,7 @@ int msevent_cancel(mspool *nsp, msevent *nse, gh_list *event_list, gh_list_elem } if (nsp->tracelevel > 0) - nsock_trace(nsp, "msevent_cancel() on event #%li (type %s)", nse->id, nse_type2str(nse->type)); + nsock_trace(nsp, "msevent_cancel on event #%li (type %s)", nse->id, nse_type2str(nse->type)); /* Now that we found the event... we go through the motions of cleanly * cancelling it */ diff --git a/nsock/src/nsock_iod.c b/nsock/src/nsock_iod.c index 7f8f3f930..6b9f3b5b7 100644 --- a/nsock/src/nsock_iod.c +++ b/nsock/src/nsock_iod.c @@ -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); }