change back to map and unodered_map

pull/1696/head
orignal 3 years ago
parent b9dd4aee8d
commit 1bb1d89fab

@ -139,7 +139,7 @@ namespace transport
std::list<boost::asio::ip::udp::endpoint> m_Introducers, m_IntroducersV6; // introducers we are connected to
std::map<boost::asio::ip::udp::endpoint, std::shared_ptr<SSUSession> > m_Sessions, m_SessionsV6;
std::map<uint32_t, std::shared_ptr<SSUSession> > m_Relays; // we are introducer
boost::container::flat_map<uint32_t, PeerTest> m_PeerTests; // nonce -> creation time in milliseconds
std::map<uint32_t, PeerTest> m_PeerTests; // nonce -> creation time in milliseconds
i2p::util::MemoryPool<Fragment> m_FragmentsPool;
i2p::util::MemoryPool<IncompleteMessage> m_IncompleteMessagesPool;

@ -12,9 +12,10 @@
#include <inttypes.h>
#include <string.h>
#include <vector>
#include <map>
#include <unordered_map>
#include <memory>
#include <boost/asio.hpp>
#include <boost/container/flat_map.hpp>
#include "I2NPProtocol.h"
#include "Identity.h"
#include "RouterInfo.h"
@ -123,9 +124,9 @@ namespace transport
private:
SSUSession& m_Session;
boost::container::flat_map<uint32_t, std::shared_ptr<IncompleteMessage> > m_IncompleteMessages;
boost::container::flat_map<uint32_t, std::shared_ptr<SentMessage> > m_SentMessages;
boost::container::flat_map<uint32_t, uint64_t> m_ReceivedMessages; // msgID -> timestamp in seconds
std::map<uint32_t, std::shared_ptr<IncompleteMessage> > m_IncompleteMessages;
std::map<uint32_t, std::shared_ptr<SentMessage> > m_SentMessages;
std::unordered_map<uint32_t, uint64_t> m_ReceivedMessages; // msgID -> timestamp in seconds
boost::asio::deadline_timer m_ResendTimer;
int m_MaxPacketSize, m_PacketSize;
i2p::I2NPMessagesHandler m_Handler;

@ -170,7 +170,7 @@ namespace transport
SSUData m_Data;
bool m_IsDataReceived;
std::unique_ptr<SignedData> m_SignedData; // we need it for SessionConfirmed only
std::unordered_map<uint32_t, std::pair <std::shared_ptr<const i2p::data::RouterInfo>, uint64_t > > m_RelayRequests; // nonce->(Charlie, timestamp)
std::map<uint32_t, std::pair <std::shared_ptr<const i2p::data::RouterInfo>, uint64_t > > m_RelayRequests; // nonce->(Charlie, timestamp)
std::shared_ptr<i2p::crypto::DHKeys> m_DHKeysPair; // X - for client and Y - for server
};
}

@ -12,7 +12,7 @@
#include <inttypes.h>
#include <vector>
#include <string>
#include <boost/container/flat_map.hpp>
#include <unordered_map>
#include "I2NPProtocol.h"
#include "TunnelBase.h"
@ -59,8 +59,8 @@ namespace tunnel
private:
boost::container::flat_map<uint32_t, TunnelMessageBlockEx> m_IncompleteMessages;
boost::container::flat_map<uint64_t, std::unique_ptr<Fragment> > m_OutOfSequenceFragments; // ((msgID << 8) + fragment#)->fragment
std::unordered_map<uint32_t, TunnelMessageBlockEx> m_IncompleteMessages;
std::unordered_map<uint64_t, std::unique_ptr<Fragment> > m_OutOfSequenceFragments; // ((msgID << 8) + fragment#)->fragment
bool m_IsInbound;
size_t m_NumReceivedBytes;
TunnelMessageBlockEx m_CurrentMessage;

Loading…
Cancel
Save