Commit b44d24e8 authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Anthony Léonard

dtls: refactoring and fix of PMTUD/Established code

There are various issues in the PMTUD code:
- OOO handler wasn't applied to the first packet
  due to unseen code duplication in PMTU code.
- first packet sequence has to be known in case of OOO on it
- bug in losts detection.
- decrease the lost threshold time.
- temporary packet allocation is not efficient.
- code duplication and functional flow not well designed.
- comments needed

This patch fixes all of that.

Change-Id: I93ec71e22f6cb7a66ad9ab0f927d31044966f1e3
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent d3eff48f
This diff is collapsed.
......@@ -210,7 +210,7 @@ private:
TlsSessionState handleStateShutdown(TlsSessionState state);
std::map<TlsSessionState, StateHandler> fsmHandlers_ {};
std::atomic<TlsSessionState> state_ {TlsSessionState::SETUP};
std::atomic<unsigned int> maxPayload_ {0};
std::atomic<unsigned int> maxPayload_;
// IO GnuTLS <-> ICE
std::mutex txMutex_ {};
......@@ -219,9 +219,10 @@ private:
std::list<std::vector<uint8_t>> rxQueue_ {};
std::mutex reorderBufMutex_;
uint64_t baseSeq_ {0}; // sequence number of first application data packet received
uint64_t lastRxSeq_ {0}; // last received and valid packet sequence number
uint64_t gapOffset_ {1}; // offset of first byte not received yet (start at 1)
std::vector<uint8_t> rawPktBuf_; ///< gnutls incoming packet buffer
uint64_t baseSeq_ {0}; ///< sequence number of first application data packet received
uint64_t lastRxSeq_ {0}; ///< last received and valid packet sequence number
uint64_t gapOffset_ {0}; ///< offset of first byte not received yet
clock::time_point lastReadTime_;
std::map<uint64_t, std::vector<uint8_t>> reorderBuffer_ {};
......@@ -231,7 +232,8 @@ private:
ssize_t recvRaw(void*, size_t);
int waitForRawData(unsigned);
void handleDataPacket(std::vector<uint8_t>&&, const uint8_t*);
bool initFromRecordState(int offset=0);
void handleDataPacket(std::vector<uint8_t>&&, uint64_t);
void flushRxQueue();
// Statistics
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment