mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
correct message type for ShortTunnelBuild
This commit is contained in:
parent
db9223b0d5
commit
bdc1107c96
|
@ -88,7 +88,7 @@ namespace tunnel
|
|||
}
|
||||
hop = hop->prev;
|
||||
}
|
||||
msg->FillI2NPMessageHeader (eI2NPVariableTunnelBuild);
|
||||
msg->FillI2NPMessageHeader (m_Config->IsShort () ? eI2NPShortTunnelBuild : eI2NPVariableTunnelBuild);
|
||||
|
||||
// send message
|
||||
if (outboundTunnel)
|
||||
|
@ -99,7 +99,7 @@ namespace tunnel
|
|||
if (ident)
|
||||
{
|
||||
auto msg1 = i2p::garlic::WrapECIESX25519MessageForRouter (msg, ident->GetEncryptionPublicKey ());
|
||||
if (msg1) msg = msg;
|
||||
if (msg1) msg = msg1;
|
||||
}
|
||||
}
|
||||
outboundTunnel->SendTunnelDataMsg (GetNextIdentHash (), 0, msg);
|
||||
|
|
|
@ -91,14 +91,17 @@ namespace tunnel
|
|||
{
|
||||
public:
|
||||
|
||||
TunnelConfig (const std::vector<std::shared_ptr<const i2p::data::IdentityEx> >& peers) // inbound
|
||||
TunnelConfig (const std::vector<std::shared_ptr<const i2p::data::IdentityEx> >& peers,
|
||||
bool isShort = false): // inbound
|
||||
m_IsShort (isShort)
|
||||
{
|
||||
CreatePeers (peers);
|
||||
m_LastHop->SetNextIdent (i2p::context.GetIdentHash ());
|
||||
}
|
||||
|
||||
TunnelConfig (const std::vector<std::shared_ptr<const i2p::data::IdentityEx> >& peers,
|
||||
uint32_t replyTunnelID, const i2p::data::IdentHash& replyIdent) // outbound
|
||||
uint32_t replyTunnelID, const i2p::data::IdentHash& replyIdent, bool isShort = false): // outbound
|
||||
m_IsShort (isShort)
|
||||
{
|
||||
CreatePeers (peers);
|
||||
m_FirstHop->isGateway = false;
|
||||
|
@ -185,7 +188,7 @@ namespace tunnel
|
|||
protected:
|
||||
|
||||
// this constructor can't be called from outside
|
||||
TunnelConfig (): m_FirstHop (nullptr), m_LastHop (nullptr)
|
||||
TunnelConfig (): m_FirstHop (nullptr), m_LastHop (nullptr), m_IsShort (false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -218,7 +221,7 @@ namespace tunnel
|
|||
private:
|
||||
|
||||
TunnelHopConfig * m_FirstHop, * m_LastHop;
|
||||
bool m_IsShort = false;
|
||||
bool m_IsShort;
|
||||
};
|
||||
|
||||
class ZeroHopsTunnelConfig: public TunnelConfig
|
||||
|
|
Loading…
Reference in a new issue