dockerize
dockerize copied to clipboard
Close connections
Hi. This PR enables close test connections and HTTP response.
dockerize keeps a test TCP connection while running, but if the server cannot accept multiple TCP connections, the test connection fills the server's slot. It should be closed.
dockerize does not read HTTP response body and does not close it now. When an unread response body exists, http.Client cannot reuse the TCP connection for the next request.
- If close the body without reading, the http.Client cannot reuse the TCP connection.
- When
client.Do()
returns error,resp.Body
may be nil. Calling Close() raise a panic.
Thanks, TIL 😊