mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
resend peer test msgs 5 and 6
This commit is contained in:
parent
15cd4feade
commit
6ebb019e15
2 changed files with 65 additions and 8 deletions
|
@ -390,6 +390,11 @@ namespace transport
|
|||
uint64_t m_LastResendTime, m_LastResendAttemptTime; // in milliseconds
|
||||
};
|
||||
|
||||
|
||||
const int SSU2_PEER_TEST_RESEND_INTERVAL = 3000; // in milliseconds
|
||||
const int SSU2_PEER_TEST_RESEND_INTERVAL_VARIANCE = 2000; // in milliseconds
|
||||
const int SSU2_PEER_TEST_MAX_NUM_RESENDS = 3;
|
||||
|
||||
class SSU2PeerTestSession: public SSU2Session // for PeerTest msgs 5,6,7
|
||||
{
|
||||
public:
|
||||
|
@ -409,12 +414,17 @@ namespace transport
|
|||
private:
|
||||
|
||||
void SendPeerTest (uint8_t msg, const uint8_t * signedData, size_t signedDataLen); // PeerTest message
|
||||
void SendPeerTest (uint8_t msg); // send or resend m_SignedData
|
||||
void HandlePeerTest (const uint8_t * buf, size_t len) override;
|
||||
|
||||
|
||||
void ScheduleResend ();
|
||||
|
||||
private:
|
||||
|
||||
uint8_t m_MsgNumReceived;
|
||||
uint8_t m_MsgNumReceived, m_NumResends;
|
||||
bool m_IsConnectedRecently, m_IsStatusChanged;
|
||||
std::vector<uint8_t> m_SignedData; // for resends
|
||||
boost::asio::deadline_timer m_PeerTestResendTimer;
|
||||
};
|
||||
|
||||
inline uint64_t CreateHeaderMask (const uint8_t * kh, const uint8_t * nonce)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue