|
|
|
@ -78,14 +78,13 @@ namespace stream
@@ -78,14 +78,13 @@ namespace stream
|
|
|
|
|
else |
|
|
|
|
delete packet; |
|
|
|
|
|
|
|
|
|
SendQuickAck (); |
|
|
|
|
if (flags & PACKET_FLAG_CLOSE) |
|
|
|
|
{ |
|
|
|
|
LogPrint ("Closed"); |
|
|
|
|
m_IsOpen = false; |
|
|
|
|
m_ReceiveQueue.WakeUp (); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
SendQuickAck (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
size_t Stream::Send (uint8_t * buf, size_t len, int timeout) |
|
|
|
@ -325,11 +324,12 @@ namespace stream
@@ -325,11 +324,12 @@ namespace stream
|
|
|
|
|
size += 256; // encryption key
|
|
|
|
|
memset (buf + size, 0, 128); |
|
|
|
|
size += 128; // signing key
|
|
|
|
|
auto tunnel = i2p::tunnel::tunnels.GetNextInboundTunnel (); |
|
|
|
|
if (tunnel) |
|
|
|
|
{ |
|
|
|
|
buf[size] = 1; // 1 lease
|
|
|
|
|
auto tunnels = i2p::tunnel::tunnels.GetInboundTunnels (5); // 5 tunnels maximum
|
|
|
|
|
buf[size] = tunnels.size (); // num leases
|
|
|
|
|
size++; // num
|
|
|
|
|
for (auto it: tunnels) |
|
|
|
|
{ |
|
|
|
|
auto tunnel = it; |
|
|
|
|
memcpy (buf + size, (const uint8_t *)tunnel->GetNextIdentHash (), 32); |
|
|
|
|
size += 32; // tunnel_gw
|
|
|
|
|
*(uint32_t *)(buf + size) = htobe32 (tunnel->GetNextTunnelID ()); |
|
|
|
@ -339,11 +339,6 @@ namespace stream
@@ -339,11 +339,6 @@ namespace stream
|
|
|
|
|
*(uint64_t *)(buf + size) = htobe64 (ts); |
|
|
|
|
size += 8; // end_date
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
buf[size] = 0; // zero leases
|
|
|
|
|
size++; // num
|
|
|
|
|
} |
|
|
|
|
Sign (buf, size, buf+ size); |
|
|
|
|
size += 40; // signature
|
|
|
|
|
|
|
|
|
|