Adds empty response on RTSP error

This commit is contained in:
Alexey Khit
2022-08-22 11:43:26 +03:00
parent 31e24c6e03
commit 4cbacfec0c

View File

@@ -2,6 +2,7 @@ package tcp
import (
"bufio"
"errors"
"fmt"
"io"
"net/textproto"
@@ -46,6 +47,9 @@ func ReadResponse(r *bufio.Reader) (*Response, error) {
if err != nil {
return nil, err
}
if line == "" {
return nil, errors.New("empty response on RTSP request")
}
ss := strings.SplitN(line, " ", 3)
if len(ss) != 3 {