mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
don't try to connect though teminated local destination
This commit is contained in:
parent
31494267e5
commit
951ec567c7
@ -494,7 +494,7 @@ namespace client
|
|||||||
context.GetAddressBook().InsertFullAddress(dest);
|
context.GetAddressBook().InsertFullAddress(dest);
|
||||||
auto leaseSet = session->localDestination->FindLeaseSet(dest->GetIdentHash());
|
auto leaseSet = session->localDestination->FindLeaseSet(dest->GetIdentHash());
|
||||||
if (leaseSet)
|
if (leaseSet)
|
||||||
Connect(leaseSet);
|
Connect(leaseSet, session);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
session->localDestination->RequestDestination(dest->GetIdentHash(),
|
session->localDestination->RequestDestination(dest->GetIdentHash(),
|
||||||
@ -509,18 +509,25 @@ namespace client
|
|||||||
SendMessageReply (SAM_STREAM_STATUS_INVALID_ID, strlen(SAM_STREAM_STATUS_INVALID_ID), true);
|
SendMessageReply (SAM_STREAM_STATUS_INVALID_ID, strlen(SAM_STREAM_STATUS_INVALID_ID), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAMSocket::Connect (std::shared_ptr<const i2p::data::LeaseSet> remote)
|
void SAMSocket::Connect (std::shared_ptr<const i2p::data::LeaseSet> remote, std::shared_ptr<SAMSession> session)
|
||||||
{
|
{
|
||||||
auto session = m_Owner.FindSession(m_ID);
|
if (!session) session = m_Owner.FindSession(m_ID);
|
||||||
if(session)
|
if (session)
|
||||||
{
|
{
|
||||||
m_SocketType = eSAMSocketTypeStream;
|
m_SocketType = eSAMSocketTypeStream;
|
||||||
m_Stream = session->localDestination->CreateStream (remote);
|
m_Stream = session->localDestination->CreateStream (remote);
|
||||||
m_Stream->Send ((uint8_t *)m_Buffer, m_BufferOffset); // connect and send
|
if (m_Stream)
|
||||||
m_BufferOffset = 0;
|
{
|
||||||
I2PReceive ();
|
m_Stream->Send ((uint8_t *)m_Buffer, m_BufferOffset); // connect and send
|
||||||
SendMessageReply (SAM_STREAM_STATUS_OK, strlen(SAM_STREAM_STATUS_OK), false);
|
m_BufferOffset = 0;
|
||||||
|
I2PReceive ();
|
||||||
|
SendMessageReply (SAM_STREAM_STATUS_OK, strlen(SAM_STREAM_STATUS_OK), false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SendMessageReply (SAM_STREAM_STATUS_INVALID_ID, strlen(SAM_STREAM_STATUS_INVALID_ID), true);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
SendMessageReply (SAM_STREAM_STATUS_INVALID_ID, strlen(SAM_STREAM_STATUS_INVALID_ID), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAMSocket::HandleConnectLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet)
|
void SAMSocket::HandleConnectLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet)
|
||||||
|
@ -134,7 +134,7 @@ namespace client
|
|||||||
size_t ProcessDatagramSend (char * buf, size_t len, const char * data); // from SAM 1.0
|
size_t ProcessDatagramSend (char * buf, size_t len, const char * data); // from SAM 1.0
|
||||||
void ExtractParams (char * buf, std::map<std::string, std::string>& params);
|
void ExtractParams (char * buf, std::map<std::string, std::string>& params);
|
||||||
|
|
||||||
void Connect (std::shared_ptr<const i2p::data::LeaseSet> remote);
|
void Connect (std::shared_ptr<const i2p::data::LeaseSet> remote, std::shared_ptr<SAMSession> session = nullptr);
|
||||||
void HandleConnectLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet);
|
void HandleConnectLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet);
|
||||||
void SendNamingLookupReply (std::shared_ptr<const i2p::data::IdentityEx> identity);
|
void SendNamingLookupReply (std::shared_ptr<const i2p::data::IdentityEx> identity);
|
||||||
void HandleNamingLookupLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet, std::string name);
|
void HandleNamingLookupLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet, std::string name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user