Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Commit

Permalink
Enable TCP_DEFER_ACCEPT only for Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Jun 13, 2016
1 parent ebb6c72 commit 99c1336
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion googler
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import ssl
import io
import logging
import os
import platform
import signal
import sys
import textwrap
Expand Down Expand Up @@ -119,7 +120,9 @@ class TLS1_2Connection(HTTPSConnection):
def connect(self):
sock = socket.create_connection((self.host, self.port),
self.timeout, self.source_address)
sock.setsockopt(socket.SOL_TCP, socket.TCP_DEFER_ACCEPT, 1)
# TCP_DEFER_ACCEPT not available on OS X
if platform.system() == 'Linux':
sock.setsockopt(socket.SOL_TCP, socket.TCP_DEFER_ACCEPT, 1)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_QUICKACK, 1)
sock.setsockopt(socket.SOL_SOCKET,socket.SO_RCVBUF,524288)
if getattr(self, '_tunnel_host', None):
Expand Down

0 comments on commit 99c1336

Please sign in to comment.