]> Git Repo - VerusCoin.git/blobdiff - src/httpserver.h
Build fix
[VerusCoin.git] / src / httpserver.h
index b377dc19fc944886df30bfe631df1fb5dcda0f2f..ba315dfddd6c40c0f54e891276a6d3c47c581869 100644 (file)
@@ -1,12 +1,15 @@
 // Copyright (c) 2015 The Bitcoin Core developers
 // Distributed under the MIT software license, see the accompanying
-// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+// file COPYING or https://www.opensource.org/licenses/mit-license.php .
 
 #ifndef BITCOIN_HTTPSERVER_H
 #define BITCOIN_HTTPSERVER_H
 
 #include <string>
 #include <stdint.h>
+#ifdef _WIN32
+#undef __cpuid
+#endif
 #include <boost/thread.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/function.hpp>
@@ -28,7 +31,7 @@ bool InitHTTPServer();
  * This is separate from InitHTTPServer to give users race-condition-free time
  * to register their handlers between InitHTTPServer and StartHTTPServer.
  */
-bool StartHTTPServer(boost::thread_group& threadGroup);
+bool StartHTTPServer();
 /** Interrupt HTTP server threads */
 void InterruptHTTPServer();
 /** Stop HTTP server */
@@ -56,11 +59,14 @@ class HTTPRequest
 {
 private:
     struct evhttp_request* req;
+
+    // For test access
+protected:
     bool replySent;
 
 public:
     HTTPRequest(struct evhttp_request* req);
-    ~HTTPRequest();
+    virtual ~HTTPRequest();
 
     enum RequestMethod {
         UNKNOWN,
@@ -76,17 +82,17 @@ public:
 
     /** Get CService (address:ip) for the origin of the http request.
      */
-    CService GetPeer();
+    virtual CService GetPeer();
 
     /** Get request method.
      */
-    RequestMethod GetRequestMethod();
+    virtual RequestMethod GetRequestMethod();
 
     /**
      * Get the request header specified by hdr, or an empty string.
      * Return an pair (isPresent,string).
      */
-    std::pair<bool, std::string> GetHeader(const std::string& hdr);
+    virtual std::pair<bool, std::string> GetHeader(const std::string& hdr);
 
     /**
      * Read request body.
@@ -101,7 +107,7 @@ public:
      *
      * @note call this before calling WriteErrorReply or Reply.
      */
-    void WriteHeader(const std::string& hdr, const std::string& value);
+    virtual void WriteHeader(const std::string& hdr, const std::string& value);
 
     /**
      * Write HTTP reply.
@@ -111,7 +117,7 @@ public:
      * @note Can be called only once. As this will give the request back to the
      * main thread, do not call any other HTTPRequest methods after calling this.
      */
-    void WriteReply(int nStatus, const std::string& strReply = "");
+    virtual void WriteReply(int nStatus, const std::string& strReply = "");
 };
 
 /** Event handler closure.
This page took 0.024605 seconds and 4 git commands to generate.