mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
* HTTPServer.{cpp,h}: cleanup
This commit is contained in:
parent
9bbff744e9
commit
48b3959cfb
|
@ -836,11 +836,10 @@ namespace http {
|
||||||
{
|
{
|
||||||
m_Acceptor.close();
|
m_Acceptor.close();
|
||||||
m_Service.stop ();
|
m_Service.stop ();
|
||||||
if (m_Thread)
|
if (m_Thread) {
|
||||||
{
|
m_Thread->join ();
|
||||||
m_Thread->join ();
|
m_Thread = nullptr;
|
||||||
m_Thread = nullptr;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTTPServer::Run ()
|
void HTTPServer::Run ()
|
||||||
|
@ -858,11 +857,10 @@ namespace http {
|
||||||
void HTTPServer::HandleAccept(const boost::system::error_code& ecode,
|
void HTTPServer::HandleAccept(const boost::system::error_code& ecode,
|
||||||
std::shared_ptr<boost::asio::ip::tcp::socket> newSocket)
|
std::shared_ptr<boost::asio::ip::tcp::socket> newSocket)
|
||||||
{
|
{
|
||||||
if (!ecode)
|
if (ecode)
|
||||||
{
|
return;
|
||||||
CreateConnection(newSocket);
|
CreateConnection(newSocket);
|
||||||
Accept ();
|
Accept ();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTTPServer::CreateConnection(std::shared_ptr<boost::asio::ip::tcp::socket> newSocket)
|
void HTTPServer::CreateConnection(std::shared_ptr<boost::asio::ip::tcp::socket> newSocket)
|
||||||
|
|
|
@ -6,7 +6,6 @@ namespace http {
|
||||||
extern const char *itoopieImage;
|
extern const char *itoopieImage;
|
||||||
extern const char *itoopieFavicon;
|
extern const char *itoopieFavicon;
|
||||||
const size_t HTTP_CONNECTION_BUFFER_SIZE = 8192;
|
const size_t HTTP_CONNECTION_BUFFER_SIZE = 8192;
|
||||||
const int HTTP_DESTINATION_REQUEST_TIMEOUT = 10; // in seconds
|
|
||||||
|
|
||||||
class HTTPConnection: public std::enable_shared_from_this<HTTPConnection>
|
class HTTPConnection: public std::enable_shared_from_this<HTTPConnection>
|
||||||
{
|
{
|
||||||
|
@ -59,9 +58,6 @@ namespace http {
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void RunRequest ();
|
virtual void RunRequest ();
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class HTTPServer
|
class HTTPServer
|
||||||
|
|
Loading…
Reference in a new issue