mirror of https://bitbucket.org/ausocean/av.git
protocol/rtsp: using int rather than int64 for Response.ConentLength
This commit is contained in:
parent
94660e730b
commit
a57d3f66ff
|
@ -100,7 +100,7 @@ type Response struct {
|
||||||
ProtoMinor int
|
ProtoMinor int
|
||||||
StatusCode int
|
StatusCode int
|
||||||
Status string
|
Status string
|
||||||
ContentLength int64
|
ContentLength int
|
||||||
Header http.Header
|
Header http.Header
|
||||||
Body io.ReadCloser
|
Body io.ReadCloser
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,10 @@ func ReadResponse(r io.Reader) (*Response, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the content length from the header.
|
// Get the content length from the header.
|
||||||
resp.ContentLength, _ = strconv.ParseInt(resp.Header.Get("Content-Length"), 10, 64)
|
resp.ContentLength, err = strconv.Atoi(resp.Header.Get("Content-Length"))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
resp.Body = closer{b, r}
|
resp.Body = closer{b, r}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
|
|
Loading…
Reference in New Issue