|
|
|
@ -19,11 +19,6 @@ namespace i2p
@@ -19,11 +19,6 @@ namespace i2p
|
|
|
|
|
{ |
|
|
|
|
namespace stream |
|
|
|
|
{ |
|
|
|
|
void SendBufferQueue::Add (const uint8_t * buf, size_t len, SendHandler handler) |
|
|
|
|
{ |
|
|
|
|
Add (std::make_shared<SendBuffer>(buf, len, handler)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SendBufferQueue::Add (std::shared_ptr<SendBuffer> buf) |
|
|
|
|
{ |
|
|
|
|
if (buf) |
|
|
|
@ -115,10 +110,7 @@ namespace stream
@@ -115,10 +110,7 @@ namespace stream
|
|
|
|
|
|
|
|
|
|
void Stream::CleanUp () |
|
|
|
|
{ |
|
|
|
|
{ |
|
|
|
|
std::unique_lock<std::mutex> l(m_SendBufferMutex); |
|
|
|
|
m_SendBuffer.CleanUp (); |
|
|
|
|
} |
|
|
|
|
while (!m_ReceiveQueue.empty ()) |
|
|
|
|
{ |
|
|
|
|
auto packet = m_ReceiveQueue.front (); |
|
|
|
@ -553,8 +545,6 @@ namespace stream
@@ -553,8 +545,6 @@ namespace stream
|
|
|
|
|
|
|
|
|
|
bool isNoAck = m_LastReceivedSequenceNumber < 0; // first packet
|
|
|
|
|
std::vector<Packet *> packets; |
|
|
|
|
{ |
|
|
|
|
std::unique_lock<std::mutex> l(m_SendBufferMutex); |
|
|
|
|
while ((m_Status == eStreamStatusNew) || (IsEstablished () && !m_SendBuffer.IsEmpty () && numMsgs > 0)) |
|
|
|
|
{ |
|
|
|
|
Packet * p = m_LocalDestination.NewPacket (); |
|
|
|
@ -638,7 +628,6 @@ namespace stream
@@ -638,7 +628,6 @@ namespace stream
|
|
|
|
|
packets.push_back (p); |
|
|
|
|
numMsgs--; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (packets.size () > 0) |
|
|
|
|
{ |
|
|
|
|
if (m_SavedPackets.empty ()) // no NACKS
|
|
|
|
|