Skip to content

Commit

Permalink
Log WHIP user agent and RTP packet if unmarshalling fails (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
biglittlebigben authored Jun 4, 2024
1 parent 44a16e9 commit 6648e2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/whip/relay_whip_track_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ func (t *RelayWhipTrackHandler) pushRTP(pkt *rtp.Packet) error {

buf, err := t.depacketizer.Unmarshal(pkt.Payload)
if err != nil {
logger.Warnw("failed unmarshalling RTP payload", err, "pkt", pkt, "payload", pkt.Payload[:min(len(pkt.Payload), 20)])
return err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/whip/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func (s *WHIPServer) handleNewWhipClient(w http.ResponseWriter, r *http.Request,
return err
}

logger.Debugw("new whip request", "streamKey", streamKey, "sdpOffer", sdpOffer.String())
logger.Debugw("new whip request", "streamKey", streamKey, "sdpOffer", sdpOffer.String(), "userAgent", r.Header.Get("User-Agent"))

resourceId, sdp, err := s.createStream(streamKey, sdpOffer.String())
if err != nil {
Expand Down

0 comments on commit 6648e2b

Please sign in to comment.