Commit 30791b3b authored by Brian Lloyd's avatar Brian Lloyd

Added fix for collector #157: hang on linux 2.2.

parent 7038f9fd
......@@ -53,7 +53,7 @@ import sys
import os
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \
ENOTCONN, ESHUTDOWN, EINTR, EISCONN
ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EAGAIN
try:
socket_map
......@@ -521,7 +521,15 @@ if os.name == 'posix':
self.fd = fd
def recv (self, *args):
return apply (os.read, (self.fd,)+args)
# NOTE: this is a difference from the Python 2.2 library
# version of asyncore.py. This prevents a hanging condition
# on Linux 2.2 based systems.
while 1:
try:
return apply (os.read, (self.fd,)+args)
except exceptions.OSError, why:
if why[0] != EAGAIN:
raise
def send (self, *args):
return apply (os.write, (self.fd,)+args)
......
......@@ -53,7 +53,7 @@ import sys
import os
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \
ENOTCONN, ESHUTDOWN, EINTR, EISCONN
ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EAGAIN
try:
socket_map
......@@ -521,7 +521,15 @@ if os.name == 'posix':
self.fd = fd
def recv (self, *args):
return apply (os.read, (self.fd,)+args)
# NOTE: this is a difference from the Python 2.2 library
# version of asyncore.py. This prevents a hanging condition
# on Linux 2.2 based systems.
while 1:
try:
return apply (os.read, (self.fd,)+args)
except exceptions.OSError, why:
if why[0] != EAGAIN:
raise
def send (self, *args):
return apply (os.write, (self.fd,)+args)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment