Fix typo in socket attribute name

The proper attribute name is 'IPPROTO_TCP', not 'IPROTO_TCP'.
This would lead to an AttributeError since socket does
not have an attribute named 'IPROTO_TCP'.

Change-Id: Ibd3c1e8d48ae57994d023bf18dd53a298466f6cb
Closes-Bug: 1430935
This commit is contained in:
David Moreau Simard 2015-03-11 13:49:20 -04:00
parent 876a3bd80a
commit 689a884e18
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ class TCPKeepAliveAdapter(adapters.HTTPAdapter):
def init_poolmanager(self, *args, **kwargs):
if requests.__version__ >= '2.4.1':
kwargs.setdefault('socket_options', [
(socket.IPROTO_TCP, socket.TCP_NODELAY, 1),
(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1),
(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
])
super(TCPKeepAliveAdapter, self).init_poolmanager(*args, **kwargs)