|
|
|
@ -31,7 +31,6 @@ namespace proxy {
@@ -31,7 +31,6 @@ namespace proxy {
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static const size_t http_buffer_size = 8192; |
|
|
|
|
class HTTPReqHandler: public i2p::client::I2PServiceHandler, public std::enable_shared_from_this<HTTPReqHandler> |
|
|
|
|
{ |
|
|
|
|
private: |
|
|
|
@ -57,9 +56,9 @@ namespace proxy {
@@ -57,9 +56,9 @@ namespace proxy {
|
|
|
|
|
void SentHTTPFailed(const boost::system::error_code & ecode); |
|
|
|
|
void HandleStreamRequestComplete (std::shared_ptr<i2p::stream::Stream> stream); |
|
|
|
|
|
|
|
|
|
uint8_t m_http_buff[http_buffer_size]; |
|
|
|
|
uint8_t m_recv_buf[8192]; |
|
|
|
|
std::string m_request; //Data left to be sent. TODO: rename to m_send_buf
|
|
|
|
|
std::shared_ptr<boost::asio::ip::tcp::socket> m_sock; |
|
|
|
|
std::string m_request; //Data left to be sent
|
|
|
|
|
std::string m_url; //URL
|
|
|
|
|
std::string m_method; //Method
|
|
|
|
|
std::string m_version; //HTTP version
|
|
|
|
@ -84,7 +83,7 @@ namespace proxy {
@@ -84,7 +83,7 @@ namespace proxy {
|
|
|
|
|
LogPrint(eLogError, "HTTPProxy: no socket for read"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
m_sock->async_receive(boost::asio::buffer(m_http_buff, http_buffer_size), |
|
|
|
|
m_sock->async_receive(boost::asio::buffer(m_recv_buf, sizeof(m_recv_buf)), |
|
|
|
|
std::bind(&HTTPReqHandler::HandleSockRecv, shared_from_this(), |
|
|
|
|
std::placeholders::_1, std::placeholders::_2)); |
|
|
|
|
} |
|
|
|
@ -302,7 +301,7 @@ namespace proxy {
@@ -302,7 +301,7 @@ namespace proxy {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (HandleData(m_http_buff, len)) |
|
|
|
|
if (HandleData(m_recv_buf, len)) |
|
|
|
|
{ |
|
|
|
|
if (m_state == DONE) |
|
|
|
|
{ |
|
|
|
|