mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
refactor: Remove call to ShutdownRequested from HTTPRequest
Pass HTTP server an interrupt object instead of having it depend on shutdown.h and global shutdown state. There is no change in behavior in this commit.
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
namespace util {
|
||||
class SignalInterrupt;
|
||||
} // namespace util
|
||||
|
||||
static const int DEFAULT_HTTP_THREADS=4;
|
||||
static const int DEFAULT_HTTP_WORKQUEUE=16;
|
||||
static const int DEFAULT_HTTP_SERVER_TIMEOUT=30;
|
||||
@@ -21,7 +25,7 @@ class HTTPRequest;
|
||||
/** Initialize HTTP server.
|
||||
* Call this before RegisterHTTPHandler or EventBase().
|
||||
*/
|
||||
bool InitHTTPServer();
|
||||
bool InitHTTPServer(const util::SignalInterrupt& interrupt);
|
||||
/** Start HTTP server.
|
||||
* This is separate from InitHTTPServer to give users race-condition-free time
|
||||
* to register their handlers between InitHTTPServer and StartHTTPServer.
|
||||
@@ -57,10 +61,11 @@ class HTTPRequest
|
||||
{
|
||||
private:
|
||||
struct evhttp_request* req;
|
||||
const util::SignalInterrupt& m_interrupt;
|
||||
bool replySent;
|
||||
|
||||
public:
|
||||
explicit HTTPRequest(struct evhttp_request* req, bool replySent = false);
|
||||
explicit HTTPRequest(struct evhttp_request* req, const util::SignalInterrupt& interrupt, bool replySent = false);
|
||||
~HTTPRequest();
|
||||
|
||||
enum RequestMethod {
|
||||
|
||||
Reference in New Issue
Block a user