| 17 | namespace client |
| 18 | { |
| 19 | void BOBI2PTunnelIncomingConnection::Established () |
| 20 | { |
| 21 | if (m_IsQuiet) |
| 22 | StreamReceive (); |
| 23 | else |
| 24 | { |
| 25 | // send destination first like received from I2P |
| 26 | std::string dest = GetStream ()->GetRemoteIdentity ()->ToBase64 (); |
| 27 | dest += "\n"; |
| 28 | if (dest.size() <= I2P_TUNNEL_CONNECTION_BUFFER_SIZE) |
| 29 | memcpy (GetStreamBuffer (), dest.c_str (), dest.size ()); |
| 30 | else |
| 31 | memset (GetStreamBuffer (), 0, I2P_TUNNEL_CONNECTION_BUFFER_SIZE); |
| 32 | HandleStreamReceive (boost::system::error_code (), dest.size ()); |
| 33 | } |
| 34 | Receive (); |
| 35 | } |
| 36 | |
| 37 | BOBI2PInboundTunnel::BOBI2PInboundTunnel (const boost::asio::ip::tcp::endpoint& ep, std::shared_ptr<ClientDestination> localDestination): |
| 38 | BOBI2PTunnel (localDestination), m_Acceptor (localDestination->GetService (), ep) |
nothing calls this directly
no test coverage detected