1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Cache DTLS packet and fast retransmit it.

This commit is contained in:
winlin 2020-08-13 14:41:11 +08:00
parent dd9a9b05d1
commit a5cefbf092
2 changed files with 31 additions and 7 deletions

View file

@ -106,6 +106,10 @@ private:
// @remark For us only, means peer maybe not done, we also need to handle the DTLS packet.
bool handshake_done_for_us;
// DTLS packet cache, only last out-going packet.
uint8_t* last_outgoing_packet_cache;
int nn_last_outgoing_packet;
// @remark: dtls_role_ default value is DTLS_SERVER.
SrsDtlsRole role_;
// @remark: dtls_version_ default value is SrsDtlsVersionAuto.
@ -126,7 +130,7 @@ public:
private:
srs_error_t do_on_dtls(char* data, int nb_data);
srs_error_t do_handshake();
void trace(uint8_t* data, int length, bool incoming, int ssl_err);
void trace(uint8_t* data, int length, bool incoming, int ssl_err, bool cache);
public:
srs_error_t get_srtp_key(std::string& recv_key, std::string& send_key);
};