| 442 | } |
| 443 | |
| 444 | void InterruptHTTPServer() |
| 445 | { |
| 446 | LogPrint(BCLog::HTTP, "Interrupting HTTP server\n"); |
| 447 | if (eventHTTP) { |
| 448 | // Unlisten sockets |
| 449 | for (evhttp_bound_socket *socket : boundSockets) { |
| 450 | evhttp_del_accept_socket(eventHTTP, socket); |
| 451 | } |
| 452 | // Reject requests on current connections |
| 453 | evhttp_set_gencb(eventHTTP, http_reject_request_cb, nullptr); |
| 454 | } |
| 455 | if (workQueue) |
| 456 | workQueue->Interrupt(); |
| 457 | } |
| 458 | |
| 459 | void StopHTTPServer() |
| 460 | { |