-
-
Save slingamn/32f5030728b9d241d128 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/requests/packages/urllib3/connectionpool.py b/requests/packages/urllib3/connectionpool.py | |
index 26f0176..31416d6 100644 | |
--- a/requests/packages/urllib3/connectionpool.py | |
+++ b/requests/packages/urllib3/connectionpool.py | |
@@ -302,6 +302,8 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods): | |
while True: | |
conn = old_pool.get(block=False) | |
if conn: | |
+ if conn.sock: | |
+ conn.sock.shutdown(socket.SHUT_RDWR) | |
conn.close() | |
except Empty: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment