mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-09 11:27:53 +00:00
init
This commit is contained in:
parent
a26dc39a6d
commit
0fe7bdf849
@ -243,9 +243,14 @@ namespace client
|
|||||||
|
|
||||||
void I2PTunnelConnectionIRC::Write (const uint8_t * buf, size_t len)
|
void I2PTunnelConnectionIRC::Write (const uint8_t * buf, size_t len)
|
||||||
{
|
{
|
||||||
|
char *p = (char*)(buf + len);
|
||||||
|
*p = '\0';
|
||||||
|
LogPrint (eLogError, "======= packet received =====\n", buf, "==============\n");
|
||||||
std::string line;
|
std::string line;
|
||||||
m_OutPacket.str ("");
|
m_OutPacket.str ("");
|
||||||
|
m_InPacket.clear ();
|
||||||
m_InPacket.write ((const char *)buf, len);
|
m_InPacket.write ((const char *)buf, len);
|
||||||
|
LogPrint (eLogError, "======= inpacket =====\n", m_InPacket.str ().c_str (), "==============\n");
|
||||||
|
|
||||||
while (!m_InPacket.eof () && !m_InPacket.fail ())
|
while (!m_InPacket.eof () && !m_InPacket.fail ())
|
||||||
{
|
{
|
||||||
@ -260,7 +265,6 @@ namespace client
|
|||||||
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';
|
||||||
@ -268,7 +272,7 @@ namespace client
|
|||||||
m_OutPacket << line << '\n';
|
m_OutPacket << line << '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LogPrint (eLogError, m_OutPacket.str ().substr (0, m_OutPacket.str ().length ()));
|
LogPrint (eLogError, "======= outpacket =====\n", m_OutPacket.str ().substr (0, m_OutPacket.str ().length ()), "============\n");
|
||||||
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 ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user