mirror of https://bitbucket.org/ausocean/av.git
protocol/rtsp: checking error from scans
This commit is contained in:
parent
39d0b5d6da
commit
9abcfb138b
|
@ -141,12 +141,18 @@ func ReadResponse(r io.Reader) (*Response, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var proto string
|
var proto string
|
||||||
fmt.Sscanf(s, "%s %d %s", &proto, &resp.StatusCode, &resp.Status)
|
_, err = fmt.Sscanf(s, "%s %d %s", &proto, &resp.StatusCode, &resp.Status)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
s1 := strings.Split(proto, "/")
|
s1 := strings.Split(proto, "/")
|
||||||
resp.Proto = s1[0]
|
resp.Proto = s1[0]
|
||||||
|
|
||||||
fmt.Sscanf(s1[1], "%d.%d", &resp.ProtoMajor, &resp.ProtoMinor)
|
_, err = fmt.Sscanf(s1[1], "%d.%d", &resp.ProtoMajor, &resp.ProtoMinor)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// Read headers.
|
// Read headers.
|
||||||
for {
|
for {
|
||||||
|
|
Loading…
Reference in New Issue