mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-29 16:24:22 +00:00
http: Force-exit event loop after predefined time
This makes sure that the event loop eventually terminates, even if an event (like an open timeout, or a hanging connection) happens to be holding it up.
This commit is contained in:
parent
de9de2de36
commit
ec908d5f7a
@ -457,6 +457,13 @@ void InterruptHTTPServer()
|
|||||||
// Reject requests on current connections
|
// Reject requests on current connections
|
||||||
evhttp_set_gencb(eventHTTP, http_reject_request_cb, NULL);
|
evhttp_set_gencb(eventHTTP, http_reject_request_cb, NULL);
|
||||||
}
|
}
|
||||||
|
if (eventBase) {
|
||||||
|
// Force-exit event loop after predefined time
|
||||||
|
struct timeval tv;
|
||||||
|
tv.tv_sec = 10;
|
||||||
|
tv.tv_usec = 0;
|
||||||
|
event_base_loopexit(eventBase, &tv);
|
||||||
|
}
|
||||||
if (workQueue)
|
if (workQueue)
|
||||||
workQueue->Interrupt();
|
workQueue->Interrupt();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user