|
|
@ -138,13 +138,29 @@ namespace tunnel |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_Gateway.SendTunnelDataMsg (gwHash, gwTunnel, msg); |
|
|
|
m_Gateway.SendTunnelDataMsg (gwHash, gwTunnel, msg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void OutboundTunnel::SendTunnelDataMsg (i2p::I2NPMessage * msg) |
|
|
|
void OutboundTunnel::SendTunnelDataMsg (std::vector<TunnelMessageBlock> msgs) |
|
|
|
{ |
|
|
|
{ |
|
|
|
SendTunnelDataMsg (nullptr, 0, msg); |
|
|
|
for (auto& it : msgs) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
switch (it.deliveryType) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case eDeliveryTypeLocal: |
|
|
|
|
|
|
|
m_Gateway.SendTunnelDataMsg (nullptr, 0, it.data); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case eDeliveryTypeTunnel: |
|
|
|
|
|
|
|
m_Gateway.SendTunnelDataMsg (it.hash, it.tunnelID, it.data); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case eDeliveryTypeRouter: |
|
|
|
|
|
|
|
m_Gateway.SendTunnelDataMsg (it.hash, 0, it.data); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
LogPrint ("Unexpected delivery type ", (int)it.deliveryType); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
m_Gateway.SendBuffer (); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tunnels tunnels; |
|
|
|
Tunnels tunnels; |
|
|
|
|
|
|
|
|
|
|
|
Tunnels::Tunnels (): m_IsRunning (false), m_IsTunnelCreated (false), |
|
|
|
Tunnels::Tunnels (): m_IsRunning (false), m_IsTunnelCreated (false), |
|
|
|