aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.h
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2023-07-07 17:32:54 -0400
committerRyan Ofsky <ryan@ofsky.org>2023-12-04 15:39:15 -0400
commit42e5829d9710ebebda5de356fab01dd7c149d5fa (patch)
tree8cd56ead90e0694b27ef162ed11547d5fd97ce1b /src/httpserver.h
parent73133c36aa9cc09546eabac18d0ea35274dd5d72 (diff)
downloadbitcoin-42e5829d9710ebebda5de356fab01dd7c149d5fa.tar.xz
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.
Diffstat (limited to 'src/httpserver.h')
-rw-r--r--src/httpserver.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/httpserver.h b/src/httpserver.h
index 036a39a023..9a49877f09 100644
--- a/src/httpserver.h
+++ b/src/httpserver.h
@@ -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 {