From e0bc73dab2211927da09067492d2aee85b7d6e65 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 28 Jan 2015 15:25:42 +0100 Subject: [PATCH] removed CorsHTTPServer --- eth/main.cpp | 2 +- libweb3jsonrpc/CorsHttpServer.cpp | 46 ------------------------------- libweb3jsonrpc/CorsHttpServer.h | 35 ----------------------- neth/main.cpp | 2 +- test/jsonrpc.cpp | 2 -- 5 files changed, 2 insertions(+), 85 deletions(-) delete mode 100644 libweb3jsonrpc/CorsHttpServer.cpp delete mode 100644 libweb3jsonrpc/CorsHttpServer.h diff --git a/eth/main.cpp b/eth/main.cpp index 515197ddc..7a128298a 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -39,7 +39,7 @@ #endif #if ETH_JSONRPC #include -#include +#include #endif #include "BuildInfo.h" using namespace std; diff --git a/libweb3jsonrpc/CorsHttpServer.cpp b/libweb3jsonrpc/CorsHttpServer.cpp deleted file mode 100644 index d0e0f8112..000000000 --- a/libweb3jsonrpc/CorsHttpServer.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of cpp-ethereum. - - cpp-ethereum is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - cpp-ethereum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with cpp-ethereum. If not, see . -*/ -/** @file CorsHttpServer.cpp - * @author Marek Kotewicz - * @date 2014 - */ - -#include "CorsHttpServer.h" - -namespace jsonrpc -{ - -int HttpServer::callback(struct mg_connection*) -{ - return 0; -} - -bool CorsHttpServer::SendResponse(std::string const& _response, void* _addInfo) -{ - struct mg_connection* conn = (struct mg_connection*) _addInfo; - if (mg_printf(conn, "HTTP/1.1 200 OK\r\n" - "Content-Type: application/json\r\n" - "Content-Length: %d\r\n" - "Access-Control-Allow-Origin: *\r\n" - "Access-Control-Allow-Headers: Content-Type\r\n" - "\r\n" - "%s",(int)_response.length(), _response.c_str()) > 0) - return true; - return false; -} - -} diff --git a/libweb3jsonrpc/CorsHttpServer.h b/libweb3jsonrpc/CorsHttpServer.h deleted file mode 100644 index 09c9f6516..000000000 --- a/libweb3jsonrpc/CorsHttpServer.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - This file is part of cpp-ethereum. - - cpp-ethereum is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - cpp-ethereum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with cpp-ethereum. If not, see . -*/ -/** @file CorsHttpServer.h - * @author Marek Kotewicz - * @date 2014 - */ - -#include - -namespace jsonrpc -{ - -class CorsHttpServer: public HttpServer -{ -public: - using HttpServer::HttpServer; - bool virtual SendResponse(std::string const& _response, void* _addInfo = NULL); -}; - -} - diff --git a/neth/main.cpp b/neth/main.cpp index abd045b1c..2c1a85241 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -32,7 +32,7 @@ #include #if ETH_JSONRPC #include -#include +#include #endif #include #include "BuildInfo.h" diff --git a/test/jsonrpc.cpp b/test/jsonrpc.cpp index 42b1a5ebb..1f0a466b2 100644 --- a/test/jsonrpc.cpp +++ b/test/jsonrpc.cpp @@ -31,8 +31,6 @@ #include #include #include -#include -//#include #include #include #include