Browse Source

rename SendTunnelDataMsg to SendTunnelDataMsgs for multiple messages

pull/1911/head
orignal 1 year ago
parent
commit
922e5915b1
  1. 4
      libi2pd/Datagram.cpp
  2. 2
      libi2pd/Destination.cpp
  3. 2
      libi2pd/NetDb.cpp
  4. 2
      libi2pd/Streaming.cpp
  5. 6
      libi2pd/Tunnel.cpp
  6. 4
      libi2pd/Tunnel.h
  7. 4
      libi2pd_client/I2CP.cpp

4
libi2pd/Datagram.cpp

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2021, The PurpleI2P Project * Copyright (c) 2013-2023, The PurpleI2P Project
* *
* This file is part of Purple i2pd project and licensed under BSD3 * This file is part of Purple i2pd project and licensed under BSD3
* *
@ -425,7 +425,7 @@ namespace datagram
if (m) if (m)
send.push_back(i2p::tunnel::TunnelMessageBlock{i2p::tunnel::eDeliveryTypeTunnel,routingPath->remoteLease->tunnelGateway, routingPath->remoteLease->tunnelID, m}); send.push_back(i2p::tunnel::TunnelMessageBlock{i2p::tunnel::eDeliveryTypeTunnel,routingPath->remoteLease->tunnelGateway, routingPath->remoteLease->tunnelID, m});
} }
routingPath->outboundTunnel->SendTunnelDataMsg(send); routingPath->outboundTunnel->SendTunnelDataMsgs(send);
} }
m_SendQueue.clear(); m_SendQueue.clear();
} }

2
libi2pd/Destination.cpp

@ -835,7 +835,7 @@ namespace client
AddSessionKey (replyKey, replyTag); AddSessionKey (replyKey, replyTag);
auto msg = WrapMessageForRouter (nextFloodfill, CreateLeaseSetDatabaseLookupMsg (dest, auto msg = WrapMessageForRouter (nextFloodfill, CreateLeaseSetDatabaseLookupMsg (dest,
request->excluded, request->replyTunnel, replyKey, replyTag, isECIES)); request->excluded, request->replyTunnel, replyKey, replyTag, isECIES));
request->outboundTunnel->SendTunnelDataMsg ( request->outboundTunnel->SendTunnelDataMsgs (
{ {
i2p::tunnel::TunnelMessageBlock i2p::tunnel::TunnelMessageBlock
{ {

2
libi2pd/NetDb.cpp

@ -1137,7 +1137,7 @@ namespace data
m_Requests.RequestComplete (randomHash, nullptr); m_Requests.RequestComplete (randomHash, nullptr);
} }
if (throughTunnels && msgs.size () > 0) if (throughTunnels && msgs.size () > 0)
outbound->SendTunnelDataMsg (msgs); outbound->SendTunnelDataMsgs (msgs);
} }
void NetDb::Flood (const IdentHash& ident, std::shared_ptr<I2NPMessage> floodMsg) void NetDb::Flood (const IdentHash& ident, std::shared_ptr<I2NPMessage> floodMsg)

2
libi2pd/Streaming.cpp

@ -925,7 +925,7 @@ namespace stream
}); });
m_NumSentBytes += it->GetLength (); m_NumSentBytes += it->GetLength ();
} }
m_CurrentOutboundTunnel->SendTunnelDataMsg (msgs); m_CurrentOutboundTunnel->SendTunnelDataMsgs (msgs);
} }
else else
{ {

6
libi2pd/Tunnel.cpp

@ -284,10 +284,10 @@ namespace tunnel
block.deliveryType = eDeliveryTypeLocal; block.deliveryType = eDeliveryTypeLocal;
block.data = msg; block.data = msg;
SendTunnelDataMsg ({block}); SendTunnelDataMsgs ({block});
} }
void OutboundTunnel::SendTunnelDataMsg (const std::vector<TunnelMessageBlock>& msgs) void OutboundTunnel::SendTunnelDataMsgs (const std::vector<TunnelMessageBlock>& msgs)
{ {
std::unique_lock<std::mutex> l(m_SendMutex); std::unique_lock<std::mutex> l(m_SendMutex);
for (auto& it : msgs) for (auto& it : msgs)
@ -306,7 +306,7 @@ namespace tunnel
{ {
} }
void ZeroHopsOutboundTunnel::SendTunnelDataMsg (const std::vector<TunnelMessageBlock>& msgs) void ZeroHopsOutboundTunnel::SendTunnelDataMsgs (const std::vector<TunnelMessageBlock>& msgs)
{ {
for (auto& msg : msgs) for (auto& msg : msgs)
{ {

4
libi2pd/Tunnel.h

@ -139,7 +139,7 @@ namespace tunnel
Tunnel (config), m_Gateway (this), m_EndpointIdentHash (config->GetLastIdentHash ()) {}; Tunnel (config), m_Gateway (this), m_EndpointIdentHash (config->GetLastIdentHash ()) {};
void SendTunnelDataMsg (const uint8_t * gwHash, uint32_t gwTunnel, std::shared_ptr<i2p::I2NPMessage> msg); void SendTunnelDataMsg (const uint8_t * gwHash, uint32_t gwTunnel, std::shared_ptr<i2p::I2NPMessage> msg);
virtual void SendTunnelDataMsg (const std::vector<TunnelMessageBlock>& msgs); // multiple messages virtual void SendTunnelDataMsgs (const std::vector<TunnelMessageBlock>& msgs); // multiple messages
const i2p::data::IdentHash& GetEndpointIdentHash () const { return m_EndpointIdentHash; }; const i2p::data::IdentHash& GetEndpointIdentHash () const { return m_EndpointIdentHash; };
virtual size_t GetNumSentBytes () const { return m_Gateway.GetNumSentBytes (); }; virtual size_t GetNumSentBytes () const { return m_Gateway.GetNumSentBytes (); };
@ -190,7 +190,7 @@ namespace tunnel
public: public:
ZeroHopsOutboundTunnel (); ZeroHopsOutboundTunnel ();
void SendTunnelDataMsg (const std::vector<TunnelMessageBlock>& msgs) override; void SendTunnelDataMsgs (const std::vector<TunnelMessageBlock>& msgs) override;
size_t GetNumSentBytes () const override { return m_NumSentBytes; }; size_t GetNumSentBytes () const override { return m_NumSentBytes; };
private: private:

4
libi2pd_client/I2CP.cpp

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2022, The PurpleI2P Project * Copyright (c) 2013-2023, The PurpleI2P Project
* *
* This file is part of Purple i2pd project and licensed under BSD3 * This file is part of Purple i2pd project and licensed under BSD3
* *
@ -230,7 +230,7 @@ namespace client
remoteLease->tunnelGateway, remoteLease->tunnelID, remoteLease->tunnelGateway, remoteLease->tunnelID,
garlic garlic
}); });
outboundTunnel->SendTunnelDataMsg (msgs); outboundTunnel->SendTunnelDataMsgs (msgs);
return true; return true;
} }
else else

Loading…
Cancel
Save