diff --git a/I2NPProtocol.cpp b/I2NPProtocol.cpp index 7216e864..862b97e9 100644 --- a/I2NPProtocol.cpp +++ b/I2NPProtocol.cpp @@ -82,7 +82,7 @@ namespace i2p I2NPMessage * CreateDeliveryStatusMsg (uint32_t msgID) { - I2NPMessage * m = NewI2NPMessage (); + I2NPMessage * m = NewI2NPShortMessage (); uint8_t * buf = m->GetPayload (); if (msgID) { diff --git a/NetDb.cpp b/NetDb.cpp index 2f659e07..ba324b37 100644 --- a/NetDb.cpp +++ b/NetDb.cpp @@ -131,7 +131,7 @@ namespace data if (msg) { int numMsgs = 0; - while (msg && numMsgs < 500) + while (msg) { switch (msg->GetTypeID ()) { @@ -151,6 +151,7 @@ namespace data LogPrint ("NetDb: unexpected message type ", msg->GetTypeID ()); i2p::HandleI2NPMessage (msg); } + if (numMsgs > 100) break; msg = m_Queue.Get (); numMsgs++; } @@ -572,12 +573,12 @@ namespace data auto pool = i2p::tunnel::tunnels.GetExploratoryPool (); auto outbound = pool ? pool->GetNextOutboundTunnel () : nullptr; auto inbound = pool ? pool->GetNextInboundTunnel () : nullptr; - std::vector msgs; if (!dest->IsExploratory ()) { // reply to our destination. Try other floodfills if (outbound && inbound ) { + std::vector msgs; auto count = dest->GetExcludedPeers ().size (); if (count < 7) { @@ -605,11 +606,12 @@ namespace data } else LogPrint (key, " was not found on 7 floodfills"); + + if (msgs.size () > 0) + outbound->SendTunnelDataMsg (msgs); } } - if (outbound && msgs.size () > 0) - outbound->SendTunnelDataMsg (msgs); if (deleteDest) { // no more requests for the destinationation. delete it