mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 02:54:01 +01:00
check if destination is ready. Create garlic message before selectiing routing path
This commit is contained in:
parent
96ea630274
commit
e0ac8a7298
|
@ -202,6 +202,7 @@ namespace client
|
||||||
LogPrint (eLogError, "I2CP: Failed to create remote session");
|
LogPrint (eLogError, "I2CP: Failed to create remote session");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
auto garlic = remoteSession->WrapSingleMessage (msg); // shared routing path mitgh be dropped here
|
||||||
auto path = remoteSession->GetSharedRoutingPath ();
|
auto path = remoteSession->GetSharedRoutingPath ();
|
||||||
std::shared_ptr<i2p::tunnel::OutboundTunnel> outboundTunnel;
|
std::shared_ptr<i2p::tunnel::OutboundTunnel> outboundTunnel;
|
||||||
std::shared_ptr<const i2p::data::Lease> remoteLease;
|
std::shared_ptr<const i2p::data::Lease> remoteLease;
|
||||||
|
@ -236,7 +237,6 @@ namespace client
|
||||||
if (remoteLease && outboundTunnel)
|
if (remoteLease && outboundTunnel)
|
||||||
{
|
{
|
||||||
std::vector<i2p::tunnel::TunnelMessageBlock> msgs;
|
std::vector<i2p::tunnel::TunnelMessageBlock> msgs;
|
||||||
auto garlic = remoteSession->WrapSingleMessage (msg);
|
|
||||||
msgs.push_back (i2p::tunnel::TunnelMessageBlock
|
msgs.push_back (i2p::tunnel::TunnelMessageBlock
|
||||||
{
|
{
|
||||||
i2p::tunnel::eDeliveryTypeTunnel,
|
i2p::tunnel::eDeliveryTypeTunnel,
|
||||||
|
@ -787,9 +787,14 @@ namespace client
|
||||||
{
|
{
|
||||||
offset += 4;
|
offset += 4;
|
||||||
uint32_t nonce = bufbe32toh (buf + offset + payloadLen);
|
uint32_t nonce = bufbe32toh (buf + offset + payloadLen);
|
||||||
if (m_IsSendAccepted)
|
if (m_Destination->IsReady ())
|
||||||
SendMessageStatusMessage (nonce, eI2CPMessageStatusAccepted); // accepted
|
{
|
||||||
m_Destination->SendMsgTo (buf + offset, payloadLen, identity.GetIdentHash (), nonce);
|
if (m_IsSendAccepted)
|
||||||
|
SendMessageStatusMessage (nonce, eI2CPMessageStatusAccepted); // accepted
|
||||||
|
m_Destination->SendMsgTo (buf + offset, payloadLen, identity.GetIdentHash (), nonce);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SendMessageStatusMessage (nonce, eI2CPMessageStatusNoLocalTunnels);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LogPrint(eLogError, "I2CP: Cannot send message, too big");
|
LogPrint(eLogError, "I2CP: Cannot send message, too big");
|
||||||
|
|
|
@ -58,6 +58,7 @@ namespace client
|
||||||
eI2CPMessageStatusAccepted = 1,
|
eI2CPMessageStatusAccepted = 1,
|
||||||
eI2CPMessageStatusGuaranteedSuccess = 4,
|
eI2CPMessageStatusGuaranteedSuccess = 4,
|
||||||
eI2CPMessageStatusGuaranteedFailure = 5,
|
eI2CPMessageStatusGuaranteedFailure = 5,
|
||||||
|
eI2CPMessageStatusNoLocalTunnels = 16,
|
||||||
eI2CPMessageStatusNoLeaseSet = 21
|
eI2CPMessageStatusNoLeaseSet = 21
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue