You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bad OOB data management when using asyncore with select.poll() #45882
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/josiahcarlson'closed_at=<Date2009-04-29.07:19:38.421>created_at=<Date2007-12-02.17:54:16.835>labels= ['type-bug', 'library']
title='Bad OOB data management when using asyncore with select.poll()'updated_at=<Date2009-04-29.07:19:38.419>user='https://github.com/giampaolo'
asyncore's module readwrite() function, used when invoking
asyncore.loop(use_poll=1), erroneously calls handle_read_event() when
receiving OOB (Out Of Band) data. handle_expt_event() should be called
instead.
The patch in attachment does that.
I'm not sure what should be called instead, if handle_read_event or
handle_read or handle_error.
I tried to take a look at how Twisted manages the thing but it seems
that OOB is not even supported.
Maybe someone with more experience in using select.poll could clarify that.
While handle_expt() is documented has only being called when OOB data is
known, it has become the catch-all for "something strange is happening
on the socket".
The reason it wasn't changed/fixed in Python 2.6 is because a new method
would need to be added, which would break previously existing asyncore-
derived applications.
Activity
giampaolo commentedon Dec 2, 2007
asyncore's module readwrite() function, used when invoking
asyncore.loop(use_poll=1), erroneously calls handle_read_event() when
receiving OOB (Out Of Band) data. handle_expt_event() should be called
instead.
The patch in attachment does that.
In addition I strongly think that POLLERR, POLLHUP and POLLNVAL events
handling is incorrect too.
As far as I read from here:
http://www.squarebox.co.uk/cgi-squarebox/manServer/usr/share/man/man0p/poll.h.0p
...they refers to the following events:
POLLERR An error has occurred (revents only).
POLLHUP Device has been disconnected ( revents only).
POLLNVAL Invalid fd member (revents only).
They are actually associated to handle_expt_event() and this is
incorrect since it should be called only when receiving OOB data.
I'm not sure what should be called instead, if handle_read_event or
handle_read or handle_error.
I tried to take a look at how Twisted manages the thing but it seems
that OOB is not even supported.
Maybe someone with more experience in using select.poll could clarify that.
josiahcarlson commentedon Oct 2, 2008
While handle_expt() is documented has only being called when OOB data is
known, it has become the catch-all for "something strange is happening
on the socket".
The reason it wasn't changed/fixed in Python 2.6 is because a new method
would need to be added, which would break previously existing asyncore-
derived applications.
I might still be able to fix it for 3.0 .
josiahcarlson commentedon Oct 2, 2008
3.0 is a no-go, no non-documentation changes allowed.
giampaolo commentedon Dec 3, 2008
This is a duplicate of bpo-4501 which provides a better patch.
birkenfeld commentedon Apr 29, 2009
Setting bpo-4501 as superseder.