Closed ronin8600 closed 7 years ago
The thing is that when you need a "Keep-Alive" Connection you don't want to close it
I'm running into this error as well. It seems like the "Keep-Alive" header doesn't apply here. The conn
object is being thrown away after use, so there's no way to submit a second request. Or am I reading HttpClient.__call__
wrong? The conn.close()
befor return solves the error for me as well.
It depend which client your using. It may be true with the one based on python builtin but not with requests/urllib3
Oh! Right, I'm talking specifically about this client: https://github.com/gawel/WSGIProxy2/blob/8de5c974d20279e8c7394e5e70441e7502192a8c/wsgiproxy/proxies.py#L74
I fixed it here, would this break anything? https://github.com/gawel/WSGIProxy2/compare/master...djeebus:clean-up-connection
I guess it's fine if the tests pass. PR welcome :)
PR incoming! =) Thanks!
I'm getting a resource warning (socket not being closed) when using WSGIProxy2 with bottle.
It looks like the connection is not being explicitly closed in HttpClient.call. I tried adding a 'conn.close()' before the return and it appears to have fixed the warning.