#include #include #include #include #include #include "Base.h" #include "Log.h" #include "Tunnel.h" #include "TransitTunnel.h" #include "Transports.h" #include "NetDb.h" #include "I2PEndian.h" #include "Streaming.h" #include "Destination.h" #include "RouterContext.h" #include "ClientContext.h" #include "HTTPServer.h" // For image and info #include "version.h" namespace i2p { namespace util { const std::string HTTPConnection::itoopieImage = "\"ICToopie"; const std::string HTTPConnection::itoopieFavicon = "data:image/vnd.microsoft.icon;base64," "AAABAAEAQEAAAAEAIAAoQgAAFgAAACgAAABAAAAAgAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAABsAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgQAAAIMAAACEAAAAg" "wAAAIAAAACCAAAASQAAACUAAAAmAAAAOwAAAFIAAABgAAAAVAAAACcAAAAVAAAADQAAAAcAAAADAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACjAAAA/wAAAP4AAAD+AAAA/gAAAP4AAAD+A" "AAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/" "AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAACbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "A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AAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAI4AAAD+AAAA/gBnjP0At/v/ALz//gAAAP+CgoLx/////////////////////////////" "///CAkJ8QBCXP4Auf7/ALj8/wBScf0DAwPw////////////////////////////////tra26AAAAP8A" "hrf+ALf7/wDA//8AHCf9AAAA/gAAAP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3AAAA/wAAAP4AEBb9AMT//wC6//8AQVn+AAAA9+Pj4" "/L/////////////////////cnJy1gAAAP8AlMr9ALf7/wC3+/8AhLT+AAAA/5mZmeL/////////////" "/////////////R0dHesAAAD9AL///gC3+/8ApuX+AAAA/gAAAP4AAAC1AAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPMAAAD+AAAA/" "gCGtv0Atvr/ALn+/wARF/0AAAD3cHBw7bGxseqioqLuOjo67QAAAP8ARFz9ALz//wC3+/8At/v/AML/" "/wAbJf0AAAD/jo6O5v////b//////f397zw8PPEAAAD/AGCC/QC4/P8Auv//AEJb/QAAAP4AAAD/AAA" "AUQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAIgAAADRAAAA/wAAA" "P8AAAD/AAAA/wAAAP8AAAD/AAAA5QAAAJoAAABWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAIAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///gAf///////4AAAAD/////wAAAAP////" "/AAAAB/////+AAAAH/////4AAAA//////gAAAD/////8AAAAH/////wAAAAP////+AAAAA/////4AAA" "AD/////gAAAAP////+AAAAA/////4AAAAD/////gAAAAP////+AAAAA/////4AAAAB/////gAAAAD//" "//+AAAAAP////wAAAAA////+AAAAAD////wAAAAAP///8AAAAAA////gAAAAAB///8AAAAAAH///gAA" "AAAAf//+AAAAAAA///4AAAAAAD///4AAAAAAP///wAAAAAAf///wAAAAAD////gAAAAAP////gAAAAB" "/////AAAAAP////+AAAAD/////wAAAAf////+AAAAB/////4AAAAD/////AAAAAP////8AAAAA/////" "wAAAAB////+AAAAAH////4AAAAAf////gAAAAA////+AAAAAD////4AAAAAP////gAAAAA////+AAAA" "AD////4AAAAAf////gAAAAB////+AAAAAH////8AAAAAf////wAAAAD/////gAAAAP////+AAAAB///" "//8AAAAH/////wAAAA//////gAAAH//////AAAA//////+AAAH//////+AAA///////+AAP///////+" "AH//////////////8="; const char HTTP_COMMAND_TUNNELS[] = "tunnels"; const char HTTP_COMMAND_TRANSIT_TUNNELS[] = "transit_tunnels"; const char HTTP_COMMAND_TRANSPORTS[] = "transports"; const char HTTP_COMMAND_START_ACCEPTING_TUNNELS[] = "start_accepting_tunnels"; const char HTTP_COMMAND_STOP_ACCEPTING_TUNNELS[] = "stop_accepting_tunnels"; const char HTTP_COMMAND_RUN_PEER_TEST[] = "run_peer_test"; const char HTTP_COMMAND_LOCAL_DESTINATIONS[] = "local_destinations"; const char HTTP_COMMAND_LOCAL_DESTINATION[] = "local_destination"; const char HTTP_PARAM_BASE32_ADDRESS[] = "b32"; const char HTTP_COMMAND_SAM_SESSIONS[] = "sam_sessions"; const char HTTP_COMMAND_SAM_SESSION[] = "sam_session"; const char HTTP_PARAM_SAM_SESSION_ID[] = "id"; namespace misc_strings { const char name_value_separator[] = { ':', ' ' }; const char crlf[] = { '\r', '\n' }; } // namespace misc_strings std::vector HTTPConnection::reply::to_buffers(int status) { std::vector buffers; if (headers.size () > 0) { status_string = "HTTP/1.1 "; status_string += std::to_string (status); status_string += " "; switch (status) { case 105: status_string += "Name Not Resolved"; break; case 200: status_string += "OK"; break; case 400: status_string += "Bad Request"; break; case 404: status_string += "Not Found"; break; case 408: status_string += "Request Timeout"; break; case 500: status_string += "Internal Server Error"; break; case 502: status_string += "Bad Gateway"; break; case 503: status_string += "Not Implemented"; break; case 504: status_string += "Gateway Timeout"; break; default: status_string += "WTF"; } buffers.push_back(boost::asio::buffer(status_string, status_string.size())); buffers.push_back(boost::asio::buffer(misc_strings::crlf)); for (std::size_t i = 0; i < headers.size(); ++i) { header& h = headers[i]; buffers.push_back(boost::asio::buffer(h.name)); buffers.push_back(boost::asio::buffer(misc_strings::name_value_separator)); buffers.push_back(boost::asio::buffer(h.value)); buffers.push_back(boost::asio::buffer(misc_strings::crlf)); } buffers.push_back(boost::asio::buffer(misc_strings::crlf)); } buffers.push_back(boost::asio::buffer(content)); return buffers; } void HTTPConnection::Terminate () { if (!m_Stream) return; m_Socket->close (); m_Stream->Close (); m_Socket->get_io_service ().post ([=](void) { m_Stream.reset (); m_Stream = nullptr; }); } void HTTPConnection::Receive () { m_Socket->async_read_some (boost::asio::buffer (m_Buffer, HTTP_CONNECTION_BUFFER_SIZE), std::bind(&HTTPConnection::HandleReceive, shared_from_this (), std::placeholders::_1, std::placeholders::_2)); } void HTTPConnection::HandleReceive (const boost::system::error_code& ecode, std::size_t bytes_transferred) { if (!ecode) { if (!m_Stream) // new request { m_Buffer[bytes_transferred] = 0; m_BufferLen = bytes_transferred; RunRequest(); } else // follow-on m_Stream->Send ((uint8_t *)m_Buffer, bytes_transferred); Receive (); } else if (ecode != boost::asio::error::operation_aborted) Terminate (); } void HTTPConnection::RunRequest () { auto address = ExtractAddress (); if (address.length () > 1 && address[1] != '?') // not just '/' or '/?' { std::string uri ("/"), b32; size_t pos = address.find ('/', 1); if (pos == std::string::npos) b32 = address.substr (1); // excluding leading '/' to end of line else { b32 = address.substr (1, pos - 1); // excluding leading '/' to next '/' uri = address.substr (pos); // rest of line } HandleDestinationRequest (b32, uri); } else HandleRequest (address); } std::string HTTPConnection::ExtractAddress () { char * get = strstr (m_Buffer, "GET"); if (get) { char * http = strstr (get, "HTTP"); if (http) return std::string (get + 4, http - get - 5); } return ""; } void HTTPConnection::ExtractParams (const std::string& str, std::map& params) { if (str[0] != '&') return; size_t pos = 1, end; do { end = str.find ('&', pos); std::string param = str.substr (pos, end - pos); LogPrint (param); size_t e = param.find ('='); if (e != std::string::npos) params[param.substr(0, e)] = param.substr(e+1); pos = end + 1; } while (end != std::string::npos); } void HTTPConnection::HandleWriteReply (const boost::system::error_code& ecode) { if (ecode != boost::asio::error::operation_aborted) { boost::system::error_code ignored_ec; m_Socket->shutdown(boost::asio::ip::tcp::socket::shutdown_both, ignored_ec); Terminate (); } } void HTTPConnection::HandleWrite (const boost::system::error_code& ecode) { if (ecode || (m_Stream && !m_Stream->IsOpen ())) { if (ecode != boost::asio::error::operation_aborted) Terminate (); } else // data keeps coming AsyncStreamReceive (); } void HTTPConnection::HandleRequest (const std::string& address) { std::stringstream s; // Html5 head start s << "\n"; // TODO: Add support for locale. s << ""; // TODO: Find something to parse html/template system. This is horrible. s << "Purple I2P " << VERSION " Webconsole"; // Head end if (address.length () > 1) HandleCommand (address.substr (2), s); else FillContent (s); s << ""; SendReply (s.str ()); } void HTTPConnection::FillContent (std::stringstream& s) { s << "

Welcome to the Webconsole!


"; s << "Uptime: " << boost::posix_time::to_simple_string ( boost::posix_time::time_duration (boost::posix_time::seconds ( i2p::context.GetUptime ()))) << "
"; s << "Status: "; switch (i2p::context.GetStatus ()) { case eRouterStatusOK: s << "OK"; break; case eRouterStatusTesting: s << "Testing"; break; case eRouterStatusFirewalled: s << "Firewalled"; break; default: s << "Unknown"; } s << "
"; s << "Tunnel creation success rate: " << i2p::tunnel::tunnels.GetTunnelCreationSuccessRate () << "%
"; s << "Received: " << i2p::transport::transports.GetTotalReceivedBytes ()/1000 << "K"; s << " (" << i2p::transport::transports.GetInBandwidth () <<" Bps)
"; s << "Sent: " << i2p::transport::transports.GetTotalSentBytes ()/1000 << "K"; s << " (" << i2p::transport::transports.GetOutBandwidth () <<" Bps)
"; s << "Data path: " << i2p::util::filesystem::GetDataDir().string() << "

"; s << "Our external address:" << "
" ; for (auto& address : i2p::context.GetRouterInfo().GetAddresses()) { switch (address.transportStyle) { case i2p::data::RouterInfo::eTransportNTCP: if (address.host.is_v6 ()) s << "NTCP6  "; else s << "NTCP  "; break; case i2p::data::RouterInfo::eTransportSSU: if (address.host.is_v6 ()) s << "SSU6     "; else s << "SSU     "; break; default: s << "Unknown  "; } s << address.host.to_string() << ":" << address.port << "
"; } s << "
Routers: " << i2p::data::netdb.GetNumRouters () << " "; s << "Floodfills: " << i2p::data::netdb.GetNumFloodfills () << " "; s << "LeaseSets: " << i2p::data::netdb.GetNumLeaseSets () << "
"; s << "
Local destinations"; s << "
Tunnels"; s << "
Transit tunnels"; s << "
Transports"; if (i2p::client::context.GetSAMBridge ()) s << "
SAM sessions"; s << "
"; if (i2p::context.AcceptsTunnels ()) s << "
Stop accepting tunnels
"; else s << "
Start accepting tunnels
"; s << "
Run peer test
"; s << "

Flibusta

"; } void HTTPConnection::HandleCommand (const std::string& command, std::stringstream& s) { size_t paramsPos = command.find('&'); std::string cmd = command.substr (0, paramsPos); if (cmd == HTTP_COMMAND_TRANSPORTS) ShowTransports (s); else if (cmd == HTTP_COMMAND_TUNNELS) ShowTunnels (s); else if (cmd == HTTP_COMMAND_TRANSIT_TUNNELS) ShowTransitTunnels (s); else if (cmd == HTTP_COMMAND_START_ACCEPTING_TUNNELS) StartAcceptingTunnels (s); else if (cmd == HTTP_COMMAND_STOP_ACCEPTING_TUNNELS) StopAcceptingTunnels (s); else if (cmd == HTTP_COMMAND_RUN_PEER_TEST) RunPeerTest (s); else if (cmd == HTTP_COMMAND_LOCAL_DESTINATIONS) ShowLocalDestinations (s); else if (cmd == HTTP_COMMAND_LOCAL_DESTINATION) { std::map params; ExtractParams (command.substr (paramsPos), params); auto b32 = params[HTTP_PARAM_BASE32_ADDRESS]; ShowLocalDestination (b32, s); } else if (cmd == HTTP_COMMAND_SAM_SESSIONS) ShowSAMSessions (s); else if (cmd == HTTP_COMMAND_SAM_SESSION) { std::map params; ExtractParams (command.substr (paramsPos), params); auto id = params[HTTP_PARAM_SAM_SESSION_ID]; ShowSAMSession (id, s); } } void HTTPConnection::ShowTransports (std::stringstream& s) { auto ntcpServer = i2p::transport::transports.GetNTCPServer (); if (ntcpServer) { s << "NTCP
"; for (auto it: ntcpServer->GetNTCPSessions ()) { if (it.second && it.second->IsEstablished ()) { // incoming connection doesn't have remote RI if (it.second->IsOutgoing ()) s << "-->"; s << i2p::data::GetIdentHashAbbreviation (it.second->GetRemoteIdentity ()->GetIdentHash ()) << ": " << it.second->GetSocket ().remote_endpoint().address ().to_string (); if (!it.second->IsOutgoing ()) s << "-->"; s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]"; s << "
"; } s << std::endl; } } auto ssuServer = i2p::transport::transports.GetSSUServer (); if (ssuServer) { s << "
SSU
"; for (auto it: ssuServer->GetSessions ()) { // incoming connections don't have remote router auto endpoint = it.second->GetRemoteEndpoint (); if (it.second->IsOutgoing ()) s << "-->"; s << endpoint.address ().to_string () << ":" << endpoint.port (); if (!it.second->IsOutgoing ()) s << "-->"; s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]"; if (it.second->GetRelayTag ()) s << " [itag:" << it.second->GetRelayTag () << "]"; s << "
"; s << std::endl; } } } void HTTPConnection::ShowTunnels (std::stringstream& s) { s << "Queue size:" << i2p::tunnel::tunnels.GetQueueSize () << "
"; for (auto it: i2p::tunnel::tunnels.GetOutboundTunnels ()) { it->Print (s); auto state = it->GetState (); if (state == i2p::tunnel::eTunnelStateFailed) s << " " << "Failed"; else if (state == i2p::tunnel::eTunnelStateExpiring) s << " " << "Exp"; s << " " << (int)it->GetNumSentBytes () << "
"; s << std::endl; } for (auto it: i2p::tunnel::tunnels.GetInboundTunnels ()) { it.second->Print (s); auto state = it.second->GetState (); if (state == i2p::tunnel::eTunnelStateFailed) s << " " << "Failed"; else if (state == i2p::tunnel::eTunnelStateExpiring) s << " " << "Exp"; s << " " << (int)it.second->GetNumReceivedBytes () << "
"; s << std::endl; } } void HTTPConnection::ShowTransitTunnels (std::stringstream& s) { for (auto it: i2p::tunnel::tunnels.GetTransitTunnels ()) { if (dynamic_cast(it.second)) s << it.second->GetTunnelID () << "-->"; else if (dynamic_cast(it.second)) s << "-->" << it.second->GetTunnelID (); else s << "-->" << it.second->GetTunnelID () << "-->"; s << " " << it.second->GetNumTransmittedBytes () << "
"; } } void HTTPConnection::ShowLocalDestinations (std::stringstream& s) { for (auto& it: i2p::client::context.GetDestinations ()) { auto ident = it.second->GetIdentHash ();; s << ""; s << i2p::client::context.GetAddressBook ().ToAddress(ident) << "
" << std::endl; } } void HTTPConnection::ShowLocalDestination (const std::string& b32, std::stringstream& s) { i2p::data::IdentHash ident; ident.FromBase32 (b32); auto dest = i2p::client::context.FindLocalDestination (ident); if (dest) { s << "Base64:
" << dest->GetIdentity ()->ToBase64 () << "

"; s << "LeaseSets: " << dest->GetNumRemoteLeaseSets () << "
"; auto pool = dest->GetTunnelPool (); if (pool) { s << "Tunnels:
"; for (auto it: pool->GetOutboundTunnels ()) { it->Print (s); auto state = it->GetState (); if (state == i2p::tunnel::eTunnelStateFailed) s << " " << "Failed"; else if (state == i2p::tunnel::eTunnelStateExpiring) s << " " << "Exp"; s << "
" << std::endl; } for (auto it: pool->GetInboundTunnels ()) { it->Print (s); auto state = it->GetState (); if (state == i2p::tunnel::eTunnelStateFailed) s << " " << "Failed"; else if (state == i2p::tunnel::eTunnelStateExpiring) s << " " << "Exp"; s << "
" << std::endl; } } s << "
Streams:
"; for (auto it: dest->GetStreamingDestination ()->GetStreams ()) { s << it.first << "->" << i2p::client::context.GetAddressBook ().ToAddress(it.second->GetRemoteIdentity ()) << " "; s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]"; s << " [out:" << it.second->GetSendQueueSize () << "][in:" << it.second->GetReceiveQueueSize () << "]"; s << "[buf:" << it.second->GetSendBufferSize () << "]"; s << "[RTT:" << it.second->GetRTT () << "]"; s << "[Window:" << it.second->GetWindowSize () << "]"; s << "[Status:" << (int)it.second->GetStatus () << "]"; s << "
"<< std::endl; } } } void HTTPConnection::ShowSAMSessions (std::stringstream& s) { auto sam = i2p::client::context.GetSAMBridge (); if (sam) { for (auto& it: sam->GetSessions ()) { s << ""; s << it.first << "
" << std::endl; } } } void HTTPConnection::ShowSAMSession (const std::string& id, std::stringstream& s) { auto sam = i2p::client::context.GetSAMBridge (); if (sam) { auto session = sam->FindSession (id); if (session) { auto& ident = session->localDestination->GetIdentHash(); s << ""; s << i2p::client::context.GetAddressBook ().ToAddress(ident) << "
" << std::endl; s << "Streams:
"; for (auto it: session->sockets) { switch (it->GetSocketType ()) { case i2p::client::eSAMSocketTypeSession: s << "session"; break; case i2p::client::eSAMSocketTypeStream: s << "stream"; break; case i2p::client::eSAMSocketTypeAcceptor: s << "acceptor"; break; default: s << "unknown"; } s << " [" << it->GetSocket ().remote_endpoint() << "]"; s << "
" << std::endl; } } } } void HTTPConnection::StartAcceptingTunnels (std::stringstream& s) { i2p::context.SetAcceptsTunnels (true); s << "Accepting tunnels started" << std::endl; } void HTTPConnection::StopAcceptingTunnels (std::stringstream& s) { i2p::context.SetAcceptsTunnels (false); s << "Accepting tunnels stopped" << std::endl; } void HTTPConnection::RunPeerTest (std::stringstream& s) { i2p::transport::transports.PeerTest (); s << "Peer test" << std::endl; } void HTTPConnection::HandleDestinationRequest (const std::string& address, const std::string& uri) { std::string request = "GET " + uri + " HTTP/1.1\r\nHost:" + address + "\r\n"; LogPrint("HTTP Client Request: ", request); SendToAddress (address, 80, request.c_str (), request.size ()); } void HTTPConnection::SendToAddress (const std::string& address, int port, const char * buf, size_t len) { i2p::data::IdentHash destination; if (!i2p::client::context.GetAddressBook ().GetIdentHash (address, destination)) { LogPrint ("Unknown address ", address); SendReply ("" + itoopieImage + "
Unknown address " + address + "", 404); return; } auto leaseSet = i2p::client::context.GetSharedLocalDestination ()->FindLeaseSet (destination); if (leaseSet && leaseSet->HasNonExpiredLeases ()) SendToDestination (leaseSet, port, buf, len); else { memcpy (m_Buffer, buf, len); m_BufferLen = len; i2p::client::context.GetSharedLocalDestination ()->RequestDestination (destination); m_Timer.expires_from_now (boost::posix_time::seconds(HTTP_DESTINATION_REQUEST_TIMEOUT)); m_Timer.async_wait (std::bind (&HTTPConnection::HandleDestinationRequestTimeout, shared_from_this (), std::placeholders::_1, destination, port, m_Buffer, m_BufferLen)); } } void HTTPConnection::HandleDestinationRequestTimeout (const boost::system::error_code& ecode, i2p::data::IdentHash destination, int port, const char * buf, size_t len) { if (ecode != boost::asio::error::operation_aborted) { auto leaseSet = i2p::client::context.GetSharedLocalDestination ()->FindLeaseSet (destination); if (leaseSet && leaseSet->HasNonExpiredLeases ()) SendToDestination (leaseSet, port, buf, len); else // still no LeaseSet SendReply (leaseSet ? "" + itoopieImage + "
Leases expired" : "" + itoopieImage + "LeaseSet not found", 504); } } void HTTPConnection::SendToDestination (std::shared_ptr remote, int port, const char * buf, size_t len) { if (!m_Stream) m_Stream = i2p::client::context.GetSharedLocalDestination ()->CreateStream (remote, port); if (m_Stream) { m_Stream->Send ((uint8_t *)buf, len); AsyncStreamReceive (); } } void HTTPConnection::AsyncStreamReceive () { if (m_Stream) m_Stream->AsyncReceive (boost::asio::buffer (m_StreamBuffer, 8192), std::bind (&HTTPConnection::HandleStreamReceive, shared_from_this (), std::placeholders::_1, std::placeholders::_2), 45); // 45 seconds timeout } void HTTPConnection::HandleStreamReceive (const boost::system::error_code& ecode, std::size_t bytes_transferred) { if (!ecode) { boost::asio::async_write (*m_Socket, boost::asio::buffer (m_StreamBuffer, bytes_transferred), std::bind (&HTTPConnection::HandleWrite, shared_from_this (), std::placeholders::_1)); } else { if (ecode == boost::asio::error::timed_out) SendReply ("" + itoopieImage + "
Not responding", 504); else if (ecode != boost::asio::error::operation_aborted) Terminate (); } } void HTTPConnection::SendReply (const std::string& content, int status) { m_Reply.content = content; m_Reply.headers.resize(3); // we need the date header to be complaint with http 1.1 std::time_t time_now = std::time(nullptr); char time_buff[128]; if (std::strftime(time_buff, sizeof(time_buff), "%a, %d %b %Y %H:%M:%S GMT", std::gmtime(&time_now))) { m_Reply.headers[0].name = "Date"; m_Reply.headers[0].value = std::string(time_buff); m_Reply.headers[1].name = "Content-Length"; m_Reply.headers[1].value = boost::lexical_cast(m_Reply.content.size()); m_Reply.headers[2].name = "Content-Type"; m_Reply.headers[2].value = "text/html"; } boost::asio::async_write (*m_Socket, m_Reply.to_buffers(status), std::bind (&HTTPConnection::HandleWriteReply, shared_from_this (), std::placeholders::_1)); } HTTPServer::HTTPServer (int port): m_Thread (nullptr), m_Work (m_Service), m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4 (), port)), m_NewSocket (nullptr) { } HTTPServer::~HTTPServer () { Stop (); } void HTTPServer::Start () { m_Thread = new std::thread (std::bind (&HTTPServer::Run, this)); m_Acceptor.listen (); Accept (); } void HTTPServer::Stop () { m_Acceptor.close(); m_Service.stop (); if (m_Thread) { m_Thread->join (); delete m_Thread; m_Thread = nullptr; } } void HTTPServer::Run () { m_Service.run (); } void HTTPServer::Accept () { m_NewSocket = new boost::asio::ip::tcp::socket (m_Service); m_Acceptor.async_accept (*m_NewSocket, boost::bind (&HTTPServer::HandleAccept, this, boost::asio::placeholders::error)); } void HTTPServer::HandleAccept(const boost::system::error_code& ecode) { if (!ecode) { CreateConnection(m_NewSocket); Accept (); } } void HTTPServer::CreateConnection(boost::asio::ip::tcp::socket * m_NewSocket) { auto conn = std::make_shared (m_NewSocket); conn->Receive (); } } }