Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docker/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,16 @@ def _get_raw_response_socket(self, response):
sock = response.raw._fp.fp.raw._sock
else:
sock = response.raw._fp.fp._sock
sock._response = response
try:
# Keep a reference to the response to stop it being garbage
# collected. If the response is garbage collected, it will close
# TLS sockets.
sock._response = response
except AttributeError:
# UNIX sockets can't have attributes set on them, but that's fine
# because we won't be doing TLS over them
pass

return sock

def _stream_helper(self, response):
Expand Down