From a4b39a36487ed9bb03f7850f50d8adad2dd48a81 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 13 Nov 2017 07:26:01 -0500 Subject: [PATCH] disable connection limiting by default --- libi2pd/Streaming.cpp | 6 ++++-- libi2pd/Streaming.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libi2pd/Streaming.cpp b/libi2pd/Streaming.cpp index db5f825e..a1cf536e 100644 --- a/libi2pd/Streaming.cpp +++ b/libi2pd/Streaming.cpp @@ -882,7 +882,8 @@ namespace stream m_PendingIncomingTimer (m_Owner->GetService ()), m_ConnTrackTimer(m_Owner->GetService()), m_ConnsPerMinute(DEFAULT_MAX_CONNS_PER_MIN), - m_LastBanClear(i2p::util::GetMillisecondsSinceEpoch()) + m_LastBanClear(i2p::util::GetMillisecondsSinceEpoch()), + m_EnableDrop(false) { } @@ -946,7 +947,7 @@ namespace stream auto incomingStream = CreateNewIncomingStream (); incomingStream->HandleNextPacket (packet); // SYN auto ident = incomingStream->GetRemoteIdentity(); - if(ident) + if(ident && m_EnableDrop) { auto ih = ident->GetIdentHash(); if(DropNewStream(ih)) @@ -1153,6 +1154,7 @@ namespace stream void StreamingDestination::SetMaxConnsPerMinute(const uint32_t conns) { + m_EnableDrop = conns > 0; m_ConnsPerMinute = conns; LogPrint(eLogDebug, "Streaming: Set max conns per minute per destination to ", conns); } diff --git a/libi2pd/Streaming.h b/libi2pd/Streaming.h index eae959ed..94b356e8 100644 --- a/libi2pd/Streaming.h +++ b/libi2pd/Streaming.h @@ -317,6 +317,7 @@ namespace stream uint64_t m_LastBanClear; i2p::util::MemoryPool m_PacketsPool; + bool m_EnableDrop; public: