| 667 | } |
| 668 | |
| 669 | void HTTPReqHandler::HandleHTTPConnectStreamRequestComplete(std::shared_ptr<i2p::stream::Stream> stream) |
| 670 | { |
| 671 | if(stream) |
| 672 | { |
| 673 | if (m_sock && m_sock->is_open ()) |
| 674 | { |
| 675 | m_ClientResponse.code = 200; |
| 676 | m_ClientResponse.status = "OK"; |
| 677 | m_send_buf = m_ClientResponse.to_string(); |
| 678 | m_sock->send(boost::asio::buffer(m_send_buf)); |
| 679 | auto connection = std::make_shared<i2p::client::I2PTunnelConnection>(GetOwner(), m_sock, stream); |
| 680 | GetOwner()->AddHandler(connection); |
| 681 | connection->I2PConnect(); |
| 682 | } |
| 683 | else |
| 684 | stream->AsyncClose (); |
| 685 | m_sock = nullptr; |
| 686 | Terminate(); |
| 687 | } |
| 688 | else |
| 689 | { |
| 690 | GenericProxyError(tr("CONNECT error"), tr("Failed to connect")); |
| 691 | } |
| 692 | } |
| 693 | |
| 694 | void HTTPReqHandler::SocksProxySuccess() |
| 695 | { |
nothing calls this directly
no test coverage detected