mirror of
https://github.com/nmap/nmap.git
synced 2026-01-11 00:49:02 +00:00
Nsock early error reporting.
Report finished (likely failed) events as early as possible. Because the corresponding IODs can have no I/O activity, they wouldn't be flagged as active by the I/O engines and the events could end up being delivered at shutdown only (or never). Reported by d33tah on http://seclists.org/nmap-dev/2014/q2/409
This commit is contained in:
@@ -1323,6 +1323,14 @@ void nsp_add_event(struct npool *nsp, struct nevent *nse) {
|
||||
default:
|
||||
fatal("Unknown nsock event type (%d)", nse->type);
|
||||
}
|
||||
|
||||
/* It can happen that the event already completed. In which case we can
|
||||
* already deliver it, even though we're probably not inside nsock_loop(). */
|
||||
if (nse->event_done) {
|
||||
event_dispatch_and_delete(nsp, nse, 1);
|
||||
update_first_events(nse);
|
||||
nevent_unref(nsp, nse);
|
||||
}
|
||||
}
|
||||
|
||||
/* An event has been completed and the handler is about to be called. This
|
||||
|
||||
Reference in New Issue
Block a user