[New-bugs-announce] [issue1541] Bad OOB data management when using asyncore with select.poll()

billiejoex report at bugs.python.org
Sun Dec 2 18:54:16 CET 2007


New submission from billiejoex:

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.

        if flags & (select.POLLERR | select.POLLHUP | select.POLLNVAL):
            obj.handle_expt_event()

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.

----------
components: Library (Lib)
files: asyncore.diff
messages: 58093
nosy: billiejoex
severity: normal
status: open
title: Bad OOB data management when using asyncore with select.poll()
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file8854/asyncore.diff

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1541>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asyncore.diff
Type: application/octet-stream
Size: 417 bytes
Desc: not available
Url : http://mail.python.org/pipermail/new-bugs-announce/attachments/20071202/da1ae2ba/attachment.obj 


More information about the New-bugs-announce mailing list