Browse Source

Windows compile fix.

cl-refactor
Gav Wood 10 years ago
parent
commit
82297c6a02
  1. 7
      libweb3jsonrpc/CorsHttpServer.cpp
  2. 4
      libweb3jsonrpc/CorsHttpServer.h

7
libweb3jsonrpc/CorsHttpServer.cpp

@ -24,12 +24,12 @@
namespace jsonrpc namespace jsonrpc
{ {
int HttpServer::callback(struct mg_connection *conn) int HttpServer::callback(struct mg_connection*)
{ {
return 0;
} }
bool CorsHttpServer::SendResponse(const std::string& _response, void* _addInfo) bool CorsHttpServer::SendResponse(std::string const& _response, void* _addInfo)
{ {
struct mg_connection* conn = (struct mg_connection*) _addInfo; struct mg_connection* conn = (struct mg_connection*) _addInfo;
if (mg_printf(conn, "HTTP/1.1 200 OK\r\n" if (mg_printf(conn, "HTTP/1.1 200 OK\r\n"
@ -41,7 +41,6 @@ bool CorsHttpServer::SendResponse(const std::string& _response, void* _addInfo)
"%s",(int)_response.length(), _response.c_str()) > 0) "%s",(int)_response.length(), _response.c_str()) > 0)
return true; return true;
return false; return false;
} }
} }

4
libweb3jsonrpc/CorsHttpServer.h

@ -24,11 +24,11 @@
namespace jsonrpc namespace jsonrpc
{ {
class CorsHttpServer : public HttpServer class CorsHttpServer: public HttpServer
{ {
public: public:
using HttpServer::HttpServer; using HttpServer::HttpServer;
bool virtual SendResponse(const std::string& _response, void* _addInfo = NULL); bool virtual SendResponse(std::string const& _response, void* _addInfo = NULL);
}; };
} }

Loading…
Cancel
Save