mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
temirminate incoming right a way if no remote LeaseSet
This commit is contained in:
parent
09b7d44dad
commit
dbef3fe9d2
2 changed files with 9 additions and 2 deletions
libi2pd
|
@ -1713,7 +1713,12 @@ namespace stream
|
|||
}
|
||||
auto incomingStream = CreateNewIncomingStream (receiveStreamID);
|
||||
incomingStream->HandleNextPacket (packet); // SYN
|
||||
auto ident = incomingStream->GetRemoteIdentity();
|
||||
if (!incomingStream->GetRemoteLeaseSet ())
|
||||
{
|
||||
LogPrint (eLogWarning, "Streaming: No remote LeaseSet for incoming stream. Terminated");
|
||||
incomingStream->Terminate (); // can't send FIN anyway
|
||||
return;
|
||||
}
|
||||
|
||||
// handle saved packets if any
|
||||
{
|
||||
|
@ -1815,6 +1820,7 @@ namespace stream
|
|||
{
|
||||
std::unique_lock<std::mutex> l(m_StreamsMutex);
|
||||
m_Streams.erase (stream->GetRecvStreamID ());
|
||||
if (stream->IsIncoming ())
|
||||
m_IncomingStreams.erase (stream->GetSendStreamID ());
|
||||
if (m_LastStream == stream) m_LastStream = nullptr;
|
||||
}
|
||||
|
|
|
@ -187,6 +187,7 @@ namespace stream
|
|||
std::shared_ptr<const i2p::data::IdentityEx> GetRemoteIdentity () const { return m_RemoteIdentity; };
|
||||
bool IsOpen () const { return m_Status == eStreamStatusOpen; };
|
||||
bool IsEstablished () const { return m_SendStreamID; };
|
||||
bool IsIncoming () const { return m_IsIncoming; };
|
||||
StreamStatus GetStatus () const { return m_Status; };
|
||||
StreamingDestination& GetLocalDestination () { return m_LocalDestination; };
|
||||
void ResetRoutingPath ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue