mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
SquashSRS4: Add security scan. Feed TWCC before drop PT.
This commit is contained in:
parent
e74810230a
commit
4f1aa924e6
3 changed files with 74 additions and 20 deletions
|
@ -1116,14 +1116,6 @@ srs_error_t SrsRtcPublishStream::on_rtp(char* data, int nb_data)
|
|||
return err;
|
||||
}
|
||||
|
||||
// If payload type is configed to drop, ignore this packet.
|
||||
if (pt_to_drop_) {
|
||||
uint8_t pt = srs_rtp_fast_parse_pt(data, nb_data);
|
||||
if (pt_to_drop_ == pt) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
// Decode the header first.
|
||||
if (twcc_id_) {
|
||||
// We must parse the TWCC from RTP header before SRTP unprotect, because:
|
||||
|
@ -1140,6 +1132,14 @@ srs_error_t SrsRtcPublishStream::on_rtp(char* data, int nb_data)
|
|||
}
|
||||
}
|
||||
|
||||
// If payload type is configed to drop, ignore this packet.
|
||||
if (pt_to_drop_) {
|
||||
uint8_t pt = srs_rtp_fast_parse_pt(data, nb_data);
|
||||
if (pt_to_drop_ == pt) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
// Decrypt the cipher to plaintext RTP data.
|
||||
char* plaintext = data;
|
||||
int nb_plaintext = nb_data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue