cjoudrey / gluahttp

gluahttp: an http module for gopher-lua
MIT License
59 stars 23 forks source link

res.Body isn't being closed on successful request #15

Closed cjoudrey closed 8 years ago

cjoudrey commented 8 years ago

// The http Client and Transport guarantee that Body is always // non-nil, even on responses without a body or responses with // a zero-length body. It is the caller's responsibility to // close Body. The default HTTP client's Transport does not // attempt to reuse HTTP/1.0 or HTTP/1.1 TCP connections // ("keep-alive") unless the Body is read to completion and is // closed.

It seems like we currently are not closing res.Body on successful request: https://github.com/cjoudrey/gluahttp/blob/9597a1d57575a0121726a2c50ad54fb74493a296/gluahttp.go#L189

erikdubbelboer commented 8 years ago

Thanks for reporting this issue, it is fixed now.

erikdubbelboer commented 8 years ago

And I just notice it's you who created the issue. I thought it was someone else :)

cjoudrey commented 8 years ago

It's actually someone who reported it via e-mail. :)

Thanks for the fix.

On Tuesday, 6 September 2016, Erik Dubbelboer notifications@github.com wrote:

And I just notice it's you who created the issue. I thought it was someone else :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cjoudrey/gluahttp/issues/15#issuecomment-244876823, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXg9sLj19bD8blFcJf0qG7ghLO3byrnks5qnRysgaJpZM4J1Vsl .