|
|
@ -255,20 +255,18 @@ namespace stream |
|
|
|
void ResetAcceptor (); |
|
|
|
void ResetAcceptor (); |
|
|
|
bool IsAcceptorSet () const { return m_Acceptor != nullptr; }; |
|
|
|
bool IsAcceptorSet () const { return m_Acceptor != nullptr; }; |
|
|
|
void AcceptOnce (const Acceptor& acceptor); |
|
|
|
void AcceptOnce (const Acceptor& acceptor); |
|
|
|
|
|
|
|
void AcceptOnceAcceptor (std::shared_ptr<Stream> stream, Acceptor acceptor, Acceptor prev); |
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<i2p::client::ClientDestination> GetOwner () const { return m_Owner; }; |
|
|
|
std::shared_ptr<i2p::client::ClientDestination> GetOwner () const { return m_Owner; }; |
|
|
|
void SetOwner (std::shared_ptr<i2p::client::ClientDestination> owner) { m_Owner = owner; }; |
|
|
|
void SetOwner (std::shared_ptr<i2p::client::ClientDestination> owner) { m_Owner = owner; }; |
|
|
|
uint16_t GetLocalPort () const { return m_LocalPort; }; |
|
|
|
uint16_t GetLocalPort () const { return m_LocalPort; }; |
|
|
|
|
|
|
|
|
|
|
|
void HandleDataMessagePayload (const uint8_t * buf, size_t len); |
|
|
|
void HandleDataMessagePayload (const uint8_t * buf, size_t len); |
|
|
|
std::shared_ptr<I2NPMessage> CreateDataMessage (const uint8_t * payload, size_t len, uint16_t toPort); |
|
|
|
std::shared_ptr<I2NPMessage> CreateDataMessage (const uint8_t * payload, size_t len, uint16_t toPort, bool checksum = true); |
|
|
|
|
|
|
|
|
|
|
|
Packet * NewPacket () { return m_PacketsPool.Acquire(); } |
|
|
|
Packet * NewPacket () { return m_PacketsPool.Acquire(); } |
|
|
|
void DeletePacket (Packet * p) { return m_PacketsPool.Release(p); } |
|
|
|
void DeletePacket (Packet * p) { return m_PacketsPool.Release(p); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AcceptOnceAcceptor (std::shared_ptr<Stream> stream, Acceptor acceptor, Acceptor prev); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
|
|
|
|
|
|
|
|
void HandleNextPacket (Packet * packet); |
|
|
|
void HandleNextPacket (Packet * packet); |
|
|
@ -289,6 +287,7 @@ namespace stream |
|
|
|
std::map<uint32_t, std::list<Packet *> > m_SavedPackets; // receiveStreamID->packets, arrived before SYN
|
|
|
|
std::map<uint32_t, std::list<Packet *> > m_SavedPackets; // receiveStreamID->packets, arrived before SYN
|
|
|
|
|
|
|
|
|
|
|
|
i2p::util::MemoryPool<Packet> m_PacketsPool; |
|
|
|
i2p::util::MemoryPool<Packet> m_PacketsPool; |
|
|
|
|
|
|
|
i2p::util::MemoryPool<I2NPMessageBuffer<I2NP_MAX_MESSAGE_SIZE> > m_I2NPMsgsPool; |
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
|
|
|
|
|
|
|
|