diff --git a/HTTPServer.cpp b/HTTPServer.cpp
index d5a4622e..d3a57b50 100644
--- a/HTTPServer.cpp
+++ b/HTTPServer.cpp
@@ -593,27 +593,6 @@ namespace http {
}
}
- void StopAcceptingTunnels (std::stringstream& s)
- {
- s << "Stop Accepting Tunnels:
\r\n
\r\n";
- i2p::context.SetAcceptsTunnels (false);
- s << "Accepting tunnels stopped" << std::endl;
- }
-
- void StartAcceptingTunnels (std::stringstream& s)
- {
- s << "Start Accepting Tunnels:
\r\n
\r\n";
- i2p::context.SetAcceptsTunnels (true);
- s << "Accepting tunnels started" << std::endl;
- }
-
- void RunPeerTest (std::stringstream& s)
- {
- s << "Run Peer Test:
\r\n
\r\n";
- i2p::transport::transports.PeerTest ();
- s << "Peer test is running" << std::endl;
- }
-
void HTTPConnection::Receive ()
{
m_Socket->async_read_some (boost::asio::buffer (m_Buffer, HTTP_CONNECTION_BUFFER_SIZE),
@@ -749,14 +728,17 @@ namespace http {
url.parse_query(params);
cmd = params["cmd"];
- if (cmd == HTTP_COMMAND_START_ACCEPTING_TUNNELS)
- StartAcceptingTunnels (s);
+ if (cmd == HTTP_COMMAND_RUN_PEER_TEST)
+ i2p::transport::transports.PeerTest ();
+ else if (cmd == HTTP_COMMAND_START_ACCEPTING_TUNNELS)
+ i2p::context.SetAcceptsTunnels (true);
else if (cmd == HTTP_COMMAND_STOP_ACCEPTING_TUNNELS)
- StopAcceptingTunnels (s);
- else if (cmd == HTTP_COMMAND_RUN_PEER_TEST)
- RunPeerTest (s);
- else
+ i2p::context.SetAcceptsTunnels (false);
+ else {
SendError("Unknown command: " + cmd);
+ return;
+ }
+ s << "Command accepted";
}
void HTTPConnection::SendReply (const std::string& content, int code)