1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-11 13:27:52 +00:00

send FIN in streaming thread

This commit is contained in:
orignal 2014-08-06 16:00:34 -04:00
parent 15b4dfbecb
commit 1ea26a113a

View File

@ -255,7 +255,8 @@ namespace stream
if (m_IsOpen)
{
m_IsOpen = false;
uint8_t packet[MAX_PACKET_SIZE];
Packet * p = new Packet ();
uint8_t * packet = p->GetBuffer ();
size_t size = 0;
*(uint32_t *)(packet + size) = htobe32 (m_SendStreamID);
size += 4; // sendStreamID
@ -277,8 +278,9 @@ namespace stream
size += 40; // signature
m_LocalDestination->Sign (packet, size, signature);
if (SendPacket (packet, size))
LogPrint ("FIN sent");
p->len = size;
m_Service.post (boost::bind (&Stream::SendPacket, this, p));
LogPrint ("FIN sent");
}
}