mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
80 column
This commit is contained in:
parent
4bfdd60501
commit
a5379e67fa
@ -43,6 +43,9 @@ monthname = [None,
|
|||||||
|
|
||||||
|
|
||||||
def close(sock):
|
def close(sock):
|
||||||
|
""" socket.close() doesn't *really* close if
|
||||||
|
there's another reference to it in the TCP/IP stack.
|
||||||
|
(trick from twisted)"""
|
||||||
try:
|
try:
|
||||||
sock.shutdown(2)
|
sock.shutdown(2)
|
||||||
except socket.error:
|
except socket.error:
|
||||||
@ -55,7 +58,7 @@ def close(sock):
|
|||||||
def read_partial(sock, length):
|
def read_partial(sock, length):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
ret = select.select([sock.fileno()], [], [], 2.0)
|
ret = select.select([sock.fileno()], [], [])
|
||||||
if ret[0]: break
|
if ret[0]: break
|
||||||
except select.error, e:
|
except select.error, e:
|
||||||
if e[0] == errno.EINTR:
|
if e[0] == errno.EINTR:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user