protocol/rtsp: using int rather than int64 for Response.ConentLength

This commit is contained in:
Saxon 2019-04-28 01:32:44 +09:30
parent 94660e730b
commit a57d3f66ff
1 changed files with 5 additions and 2 deletions

View File

@ -100,7 +100,7 @@ type Response struct {
ProtoMinor int
StatusCode int
Status string
ContentLength int64
ContentLength int
Header http.Header
Body io.ReadCloser
}
@ -184,7 +184,10 @@ func ReadResponse(r io.Reader) (*Response, error) {
}
// 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}
return resp, nil