mirror of
https://github.com/python/cpython.git
synced 2025-12-10 19:10:59 +00:00
Merged revisions 88722 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88722 | giampaolo.rodola | 2011-03-03 14:57:47 +0100 (gio, 03 mar 2011) | 1 line Fix issue 11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors on accept(), recv() and send(). ........
This commit is contained in:
parent
88f416e425
commit
2f95dc0225
2 changed files with 10 additions and 3 deletions
|
|
@ -52,7 +52,11 @@ import sys
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \
|
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \
|
||||||
ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, errorcode
|
ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, EPIPE, \
|
||||||
|
EAGAIN, errorcode
|
||||||
|
|
||||||
|
_DISCONNECTED = frozenset((ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED, EPIPE,
|
||||||
|
EBADF))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
socket_map
|
socket_map
|
||||||
|
|
@ -107,7 +111,7 @@ def readwrite(obj, flags):
|
||||||
if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
|
if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
|
||||||
obj.handle_close()
|
obj.handle_close()
|
||||||
except socket.error as e:
|
except socket.error as e:
|
||||||
if e.args[0] not in (EBADF, ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED):
|
if e.args[0] not in _DISCONNECTED:
|
||||||
obj.handle_error()
|
obj.handle_error()
|
||||||
else:
|
else:
|
||||||
obj.handle_close()
|
obj.handle_close()
|
||||||
|
|
@ -349,7 +353,7 @@ class dispatcher:
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return None
|
return None
|
||||||
except socket.error as why:
|
except socket.error as why:
|
||||||
if why.args[0] in (EWOULDBLOCK, ECONNABORTED):
|
if why.args[0] in (EWOULDBLOCK, ECONNABORTED, EAGAIN):
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors
|
||||||
|
on accept(), send() and recv().
|
||||||
|
|
||||||
- Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers
|
- Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers
|
||||||
larger than 4GB. Patch by Nadeem Vawda.
|
larger than 4GB. Patch by Nadeem Vawda.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue