don't assert after poll returns! Instead close socket on hangup.

This commit is contained in:
ehouse 2005-04-03 17:02:09 +00:00
parent 11c732ef7a
commit 97b0998eaf

View file

@ -233,11 +233,16 @@ XWThreadPool::real_listener()
for ( i = 0; i < nSockets && nEvents > 0; ++i ) { for ( i = 0; i < nSockets && nEvents > 0; ++i ) {
if ( curfd->revents != 0 ) { if ( curfd->revents != 0 ) {
assert( curfd->revents == POLLIN );
int socket = curfd->fd; int socket = curfd->fd;
RemoveSocket( socket ); RemoveSocket( socket );
logf( "enqueuing %d", socket );
enqueue( socket ); if ( curfd->revents == POLLIN || curfd->revents == POLLPRI ) {
logf( "enqueuing %d", socket );
enqueue( socket );
} else {
logf( "odd revents: %d", curfd->revents );
killSocket( socket, "error/hup in poll()" );
}
--nEvents; --nEvents;
} }
++curfd; ++curfd;