|
|
@ -323,8 +323,12 @@ namespace util |
|
|
|
} |
|
|
|
} |
|
|
|
s << "<p><a href=\"zmw2cyw2vj7f6obx3msmdvdepdhnw2ctc4okza2zjxlukkdfckhq\">Flibusta</a></p>"; |
|
|
|
s << "<p><a href=\"zmw2cyw2vj7f6obx3msmdvdepdhnw2ctc4okza2zjxlukkdfckhq\">Flibusta</a></p>"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void HTTPConnection::HandleDestinationRequest (const std::string& address, const std::string& uri) |
|
|
|
void HTTPConnection::HandleDestinationRequest (const std::string& address, const std::string& uri) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
HandleDestinationRequest(address, "GET", "", uri); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void HTTPConnection::HandleDestinationRequest (const std::string& address, const std::string& method, const std::string& data, const std::string& uri) |
|
|
|
{ |
|
|
|
{ |
|
|
|
i2p::data::IdentHash destination; |
|
|
|
i2p::data::IdentHash destination; |
|
|
|
std::string fullAddress; |
|
|
|
std::string fullAddress; |
|
|
@ -380,7 +384,13 @@ namespace util |
|
|
|
m_Stream = i2p::stream::CreateStream (*leaseSet); |
|
|
|
m_Stream = i2p::stream::CreateStream (*leaseSet); |
|
|
|
if (m_Stream) |
|
|
|
if (m_Stream) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::string request = "GET " + uri + " HTTP/1.1\n Host:" + fullAddress + "\n"; |
|
|
|
std::string request = method+" " + uri + " HTTP/1.1\n Host:" + fullAddress + "\r\n"; |
|
|
|
|
|
|
|
if (!strcmp(method.c_str(), "GET")) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// POST/PUT, apply body
|
|
|
|
|
|
|
|
request += "\r\n"+ data; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
LogPrint("HTTP Client Request: ", request); |
|
|
|
m_Stream->Send ((uint8_t *)request.c_str (), request.length (), 10); |
|
|
|
m_Stream->Send ((uint8_t *)request.c_str (), request.length (), 10); |
|
|
|
AsyncStreamReceive (); |
|
|
|
AsyncStreamReceive (); |
|
|
|
} |
|
|
|
} |
|
|
|