mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
fill option data for SYN packet
This commit is contained in:
parent
968623015c
commit
20aa516121
@ -87,12 +87,8 @@ namespace stream
|
|||||||
if (m_IsOpen)
|
if (m_IsOpen)
|
||||||
SendQuickAck ();
|
SendQuickAck ();
|
||||||
else if (isSyn)
|
else if (isSyn)
|
||||||
{
|
|
||||||
// we have to send SYN back to incoming connection
|
// we have to send SYN back to incoming connection
|
||||||
m_IsOpen = true;
|
Send (nullptr, 0, 0); // also sets m_IsOpen
|
||||||
SendQuickAck (true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -232,7 +228,7 @@ namespace stream
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Stream::SendQuickAck (bool syn)
|
void Stream::SendQuickAck ()
|
||||||
{
|
{
|
||||||
uint8_t packet[MAX_PACKET_SIZE];
|
uint8_t packet[MAX_PACKET_SIZE];
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
@ -247,7 +243,7 @@ namespace stream
|
|||||||
packet[size] = 0;
|
packet[size] = 0;
|
||||||
size++; // NACK count
|
size++; // NACK count
|
||||||
size++; // resend delay
|
size++; // resend delay
|
||||||
*(uint16_t *)(packet + size) = syn ? htobe16 (PACKET_FLAG_SYNCHRONIZE) : 0; // nof flags set
|
*(uint16_t *)(packet + size) = 0; // nof flags set
|
||||||
size += 2; // flags
|
size += 2; // flags
|
||||||
*(uint16_t *)(packet + size) = 0; // no options
|
*(uint16_t *)(packet + size) = 0; // no options
|
||||||
size += 2; // options size
|
size += 2; // options size
|
||||||
|
@ -95,7 +95,7 @@ namespace stream
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void SendQuickAck (bool syn = false);
|
void SendQuickAck ();
|
||||||
bool SendPacket (Packet * packet);
|
bool SendPacket (Packet * packet);
|
||||||
bool SendPacket (const uint8_t * buf, size_t len);
|
bool SendPacket (const uint8_t * buf, size_t len);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user