From 913438e3ff767990336cff0718704e123adc6975 Mon Sep 17 00:00:00 2001 From: atnaguzin <atnaguzin@gmail.com> Date: Thu, 17 Nov 2016 06:04:29 +0300 Subject: [PATCH] addresshelper message changed to "Proxy info" --- HTTPProxy.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/HTTPProxy.cpp b/HTTPProxy.cpp index 60b6bc33..c40989d1 100644 --- a/HTTPProxy.cpp +++ b/HTTPProxy.cpp @@ -29,7 +29,7 @@ namespace proxy { static const char *pageHead = "<head>\r\n" - " <title>I2P HTTP proxy: error</title>\r\n" + " <title>I2Pd HTTP proxy</title>\r\n" " <style type=\"text/css\">\r\n" " body { font: 100%/1.5em sans-serif; margin: 0; padding: 1.5em; background: #FAFAFA; color: #103456; }\r\n" " .header { font-size: 2.5em; text-align: center; margin: 1.5em 0; color: #894C84; }\r\n" @@ -60,6 +60,7 @@ namespace proxy { void HandleStreamRequestComplete (std::shared_ptr<i2p::stream::Stream> stream); /* error helpers */ void GenericProxyError(const char *title, const char *description); + void GenericProxyInfo(const char *title, const char *description); void HostNotFound(std::string & host); void SendProxyError(std::string & content); @@ -107,6 +108,14 @@ namespace proxy { SendProxyError(content); } + void HTTPReqHandler::GenericProxyInfo(const char *title, const char *description) { + std::stringstream ss; + ss << "<h1>Proxy info: " << title << "</h1>\r\n"; + ss << "<p>" << description << "</p>\r\n"; + std::string content = ss.str(); + SendProxyError(content); + } + void HTTPReqHandler::HostNotFound(std::string & host) { std::stringstream ss; ss << "<h1>Proxy error: Host not found</h1>\r\n" @@ -216,7 +225,7 @@ namespace proxy { std::stringstream ss; ss << "Host " << url.host << " added to router's addressbook from helper. " << "Click <a href=\"" << full_url << "\">here</a> to proceed."; - GenericProxyError("Addresshelper found", ss.str().c_str()); + GenericProxyInfo("Addresshelper found", ss.str().c_str()); return true; /* request processed */ }