mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
localsocket: handle POLLIN on hang up properly
This commit is contained in:
@@ -109,7 +109,7 @@ static int clientpoll(localsocket_t *localsocket, int events) {
|
|||||||
|
|
||||||
// server disconnected
|
// server disconnected
|
||||||
if (server == NULL)
|
if (server == NULL)
|
||||||
return POLLHUP;
|
return POLLHUP | ((events & POLLIN) ? POLLIN : 0);
|
||||||
|
|
||||||
// the client has one more possible poll check:
|
// the client has one more possible poll check:
|
||||||
// it can still be connecting with the other end
|
// it can still be connecting with the other end
|
||||||
@@ -125,7 +125,7 @@ static int serverpoll(localsocket_t *localsocket, int events) {
|
|||||||
|
|
||||||
// client disconnected
|
// client disconnected
|
||||||
if (client == NULL)
|
if (client == NULL)
|
||||||
return POLLHUP;
|
return POLLHUP | ((events & POLLIN) ? POLLIN : 0);
|
||||||
|
|
||||||
return datapoll(localsocket, client, events);
|
return datapoll(localsocket, client, events);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user