|
|
@ -249,25 +249,26 @@ namespace client |
|
|
|
|
|
|
|
|
|
|
|
while (!m_InPacket.eof () && !m_InPacket.fail ()) |
|
|
|
while (!m_InPacket.eof () && !m_InPacket.fail ()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::getline (m_InPacket, line); |
|
|
|
std::getline (m_InPacket, line); |
|
|
|
auto pos = line.find ("USER"); |
|
|
|
auto pos = line.find ("USER"); |
|
|
|
if (pos != std::string::npos && pos == 0) |
|
|
|
if (pos != std::string::npos && pos == 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
pos = line.find (" "); |
|
|
|
pos = line.find (" "); |
|
|
|
pos++; |
|
|
|
pos++; |
|
|
|
pos = line.find (" ", pos); |
|
|
|
pos = line.find (" ", pos); |
|
|
|
pos++; |
|
|
|
pos++; |
|
|
|
pos = line.find (" ", pos); |
|
|
|
pos = line.find (" ", pos); |
|
|
|
pos++; |
|
|
|
pos++; |
|
|
|
auto nextpos = line.find (" ", pos); |
|
|
|
auto nextpos = line.find (" ", pos); |
|
|
|
|
|
|
|
|
|
|
|
m_OutPacket << line.substr (0, pos); |
|
|
|
m_OutPacket << line.substr (0, pos); |
|
|
|
m_OutPacket << context.GetAddressBook ().ToAddress (m_From->GetIdentHash ()); |
|
|
|
m_OutPacket << context.GetAddressBook ().ToAddress (m_From->GetIdentHash ()); |
|
|
|
m_OutPacket << line.substr (nextpos) << '\n'; |
|
|
|
m_OutPacket << line.substr (nextpos) << '\n'; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
m_OutPacket << line << '\n'; |
|
|
|
m_OutPacket << line << '\n'; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
LogPrint (eLogError, m_OutPacket.str ().substr (0, m_OutPacket.str ().length ())); |
|
|
|
I2PTunnelConnection::Write ((uint8_t *)m_OutPacket.str ().c_str (), m_OutPacket.str ().length ()); |
|
|
|
I2PTunnelConnection::Write ((uint8_t *)m_OutPacket.str ().c_str (), m_OutPacket.str ().length ()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -477,15 +478,15 @@ namespace client |
|
|
|
|
|
|
|
|
|
|
|
I2PServerTunnelIRC::I2PServerTunnelIRC (const std::string& name, const std::string& address, |
|
|
|
I2PServerTunnelIRC::I2PServerTunnelIRC (const std::string& name, const std::string& address, |
|
|
|
int port, std::shared_ptr<ClientDestination> localDestination, int inport): |
|
|
|
int port, std::shared_ptr<ClientDestination> localDestination, int inport): |
|
|
|
I2PServerTunnel (name, address, port, localDestination, inport) |
|
|
|
I2PServerTunnel (name, address, port, localDestination, inport) |
|
|
|
{ |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void I2PServerTunnelIRC::CreateI2PConnection (std::shared_ptr<i2p::stream::Stream> stream) |
|
|
|
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 (), GetAddress ()); |
|
|
|
AddHandler (conn); |
|
|
|
AddHandler (conn); |
|
|
|
conn->Connect (); |
|
|
|
conn->Connect (); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|