mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Refine error log, show some plaintext body bytes.
This commit is contained in:
parent
77b6151857
commit
77403dd970
2 changed files with 21 additions and 2 deletions
|
@ -1038,8 +1038,24 @@ srs_error_t SrsRtcPublishStream::on_rtp(char* data, int nb_data)
|
||||||
_srs_blackhole->sendto(unprotected_buf, nb_unprotected_buf);
|
_srs_blackhole->sendto(unprotected_buf, nb_unprotected_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* buf = unprotected_buf;
|
// Handle the plaintext RTP packet.
|
||||||
int nb_buf = nb_unprotected_buf;
|
if ((err = do_on_rtp(unprotected_buf, nb_unprotected_buf)) != srs_success) {
|
||||||
|
int nb_header = h.nb_bytes();
|
||||||
|
const char* body = unprotected_buf + nb_header;
|
||||||
|
int nb_body = nb_unprotected_buf - nb_header;
|
||||||
|
return srs_error_wrap(err, "cipher=%u, plaintext=%u, body=%s", nb_data, nb_unprotected_buf,
|
||||||
|
srs_string_dumps_hex(body, nb_body, 8).c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
srs_error_t SrsRtcPublishStream::do_on_rtp(char* plaintext, int nb_plaintext)
|
||||||
|
{
|
||||||
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
|
char* buf = plaintext;
|
||||||
|
int nb_buf = nb_plaintext;
|
||||||
|
|
||||||
// Decode the RTP packet from buffer.
|
// Decode the RTP packet from buffer.
|
||||||
SrsRtpPacket2* pkt = new SrsRtpPacket2();
|
SrsRtpPacket2* pkt = new SrsRtpPacket2();
|
||||||
|
|
|
@ -261,6 +261,9 @@ private:
|
||||||
srs_error_t send_rtcp_xr_rrtr();
|
srs_error_t send_rtcp_xr_rrtr();
|
||||||
public:
|
public:
|
||||||
srs_error_t on_rtp(char* buf, int nb_buf);
|
srs_error_t on_rtp(char* buf, int nb_buf);
|
||||||
|
private:
|
||||||
|
srs_error_t do_on_rtp(char* plaintext, int nb_plaintext);
|
||||||
|
public:
|
||||||
virtual void on_before_decode_payload(SrsRtpPacket2* pkt, SrsBuffer* buf, ISrsRtpPayloader** ppayload);
|
virtual void on_before_decode_payload(SrsRtpPacket2* pkt, SrsBuffer* buf, ISrsRtpPayloader** ppayload);
|
||||||
private:
|
private:
|
||||||
srs_error_t send_periodic_twcc();
|
srs_error_t send_periodic_twcc();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue