streaming

Media streaming and broadcast systems in Go
Log | Files | Refs | README | LICENSE

commit 707b0c4f5fd7c7acd55fa9e93b8f7344e3e83276
parent f62ba4580683b9231f5608a097aa281961f16c1b
Author: Oliver Lowe <o@olowe.co>
Date:   Sat, 22 Mar 2025 16:49:28 +1100

sip: write body of request only when it's non-nil

duh

Diffstat:
Minternal/sip/sip.go | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/internal/sip/sip.go b/internal/sip/sip.go @@ -106,8 +106,11 @@ func WriteRequest(w io.Writer, req *Request) (n int64, err error) { return n, err } - nn, err := io.Copy(w, req.Body) - n += nn + if req.Body != nil { + var nn int64 + nn, err = io.Copy(w, req.Body) + n += nn + } return n, err }