mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
* HTTPServer.{cpp,h}: chg HandleRequest() signature
This commit is contained in:
parent
19b0c266f9
commit
9bbff744e9
@ -271,7 +271,7 @@ namespace http {
|
|||||||
}
|
}
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
return; /* need more data */
|
return; /* need more data */
|
||||||
HandleRequest (request);
|
HandleRequest (request.uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTTPConnection::HandleWriteReply (const boost::system::error_code& ecode)
|
void HTTPConnection::HandleWriteReply (const boost::system::error_code& ecode)
|
||||||
@ -295,7 +295,7 @@ namespace http {
|
|||||||
AsyncStreamReceive ();
|
AsyncStreamReceive ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTTPConnection::HandleRequest (const HTTPReq &request)
|
void HTTPConnection::HandleRequest (const std::string &uri)
|
||||||
{
|
{
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
// Html5 head start
|
// Html5 head start
|
||||||
@ -332,10 +332,10 @@ namespace http {
|
|||||||
s << " <a href=/?cmd=" << HTTP_COMMAND_START_ACCEPTING_TUNNELS << ">Start accepting tunnels</a><br>\r\n";
|
s << " <a href=/?cmd=" << HTTP_COMMAND_START_ACCEPTING_TUNNELS << ">Start accepting tunnels</a><br>\r\n";
|
||||||
s << "</div>\r\n";
|
s << "</div>\r\n";
|
||||||
s << "<div class=right>";
|
s << "<div class=right>";
|
||||||
if (request.uri.find("page=") != std::string::npos)
|
if (uri.find("page=") != std::string::npos)
|
||||||
HandlePage (s, request.uri);
|
HandlePage (s, uri);
|
||||||
else if (request.uri.find("cmd=") != std::string::npos)
|
else if (uri.find("cmd=") != std::string::npos)
|
||||||
HandleCommand (s, request.uri);
|
HandleCommand (s, uri);
|
||||||
else
|
else
|
||||||
ShowStatus (s);
|
ShowStatus (s);
|
||||||
s <<
|
s <<
|
||||||
|
@ -28,7 +28,7 @@ namespace http {
|
|||||||
void SendReply (const std::string& content, int code = 200);
|
void SendReply (const std::string& content, int code = 200);
|
||||||
void SendError (const std::string& message);
|
void SendError (const std::string& message);
|
||||||
|
|
||||||
void HandleRequest (const HTTPReq & request);
|
void HandleRequest (const std::string& uri);
|
||||||
void HandlePage (std::stringstream& s, const std::string& request);
|
void HandlePage (std::stringstream& s, const std::string& request);
|
||||||
void HandleCommand (std::stringstream& s, const std::string& request);
|
void HandleCommand (std::stringstream& s, const std::string& request);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user