|
|
|
@ -236,13 +236,21 @@ namespace client
@@ -236,13 +236,21 @@ namespace client
|
|
|
|
|
|
|
|
|
|
I2PTunnelConnectionIRC::I2PTunnelConnectionIRC (I2PService * owner, std::shared_ptr<i2p::stream::Stream> stream, |
|
|
|
|
std::shared_ptr<boost::asio::ip::tcp::socket> socket, |
|
|
|
|
const boost::asio::ip::tcp::endpoint& target, const std::string& host): |
|
|
|
|
I2PTunnelConnection (owner, stream, socket, target), m_Host (host), m_From (stream->GetRemoteIdentity ()) |
|
|
|
|
const boost::asio::ip::tcp::endpoint& target, const std::string& webircpass): |
|
|
|
|
I2PTunnelConnection (owner, stream, socket, target), m_From (stream->GetRemoteIdentity ()), |
|
|
|
|
m_isWebIrced (webircpass.length() ? false : true), m_WebircPass (webircpass) |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void I2PTunnelConnectionIRC::Write (const uint8_t * buf, size_t len) |
|
|
|
|
{ |
|
|
|
|
if (!m_isWebIrced) { |
|
|
|
|
m_isWebIrced = true; |
|
|
|
|
m_OutPacket.str (""); |
|
|
|
|
m_OutPacket << "WEBIRC " << this->m_WebircPass << " cgiirc " << context.GetAddressBook ().ToAddress (m_From->GetIdentHash ()) << " 127.0.0.1\n"; |
|
|
|
|
I2PTunnelConnection::Write ((uint8_t *)m_OutPacket.str ().c_str (), m_OutPacket.str ().length ()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string line; |
|
|
|
|
m_OutPacket.str (""); |
|
|
|
|
m_InPacket.clear (); |
|
|
|
@ -477,16 +485,19 @@ namespace client
@@ -477,16 +485,19 @@ namespace client
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
I2PServerTunnelIRC::I2PServerTunnelIRC (const std::string& name, const std::string& address, |
|
|
|
|
int port, std::shared_ptr<ClientDestination> localDestination, int inport, bool gzip): |
|
|
|
|
I2PServerTunnel (name, address, port, localDestination, inport, gzip) |
|
|
|
|
int port, std::shared_ptr<ClientDestination> localDestination, |
|
|
|
|
const std::string& webircpass, int inport, bool gzip): |
|
|
|
|
I2PServerTunnel (name, address, port, localDestination, inport, gzip), |
|
|
|
|
m_WebircPass (webircpass) |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void I2PServerTunnelIRC::CreateI2PConnection (std::shared_ptr<i2p::stream::Stream> stream) |
|
|
|
|
{ |
|
|
|
|
auto conn = std::make_shared<I2PTunnelConnectionIRC> (this, stream, std::make_shared<boost::asio::ip::tcp::socket> (GetService ()), GetEndpoint (), GetAddress ()); |
|
|
|
|
auto conn = std::make_shared<I2PTunnelConnectionIRC> (this, stream, std::make_shared<boost::asio::ip::tcp::socket> (GetService ()), GetEndpoint (), this->m_WebircPass); |
|
|
|
|
AddHandler (conn); |
|
|
|
|
conn->Connect (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|