Commit f732adc
authored
io BUGFIX do not fail when there is data left to read (#229)
When using the UNIX transport and depending on the timing between the
server and client, the client may read the final reply to the
<close-session> rpc *after* the server has closed the socket. When that
occurs, poll() returns POLLHUP in revents meaning the server closed the
socket which causes the following error on the client:
ERR: Session 1: communication channel unexpectedly closed.
ERR: Session 1: failed to receive a reply to <close-session>.
When POLLHUP is returned in revents, make sure POLLIN is not present as
well (if it is, it means that there is some data left to be read in the
socket buffer).
Link: https://www.greenend.org.uk/rjk/tech/poll.html
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>1 parent f8512cc commit f732adc
1 file changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | 608 | | |
615 | 609 | | |
616 | 610 | | |
617 | 611 | | |
618 | 612 | | |
619 | 613 | | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
620 | 622 | | |
621 | 623 | | |
622 | 624 | | |
| |||
0 commit comments