RTSP response Unmarshal error fixes (original) (raw)
Linked with #807 issue, and repairs #928 pull request.
#928 is a partial solution. Indeed func Unmarshal from "pkg/base/response.go" does not check if a "status message" is empty, but a little bit earlier func readBytesLimited from "pkg/base/utils.go" returns error (buffer length exceeds 4), while parsing "status code", because "status code" is followed by '\r' and not ' ' (space).
In the end, readBytesLimited should check not only for "delim byte" (in this case ' '), but also for '\r'.
I propose another PR for fixing this.