mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
don't assert after poll returns! Instead close socket on hangup.
This commit is contained in:
parent
11c732ef7a
commit
97b0998eaf
1 changed files with 8 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue