Commit b2111a3
module/sock: detect POLLHUP in is_connected with buffered data
When the peer closes a connection but unread data remains in the
receive buffer, recv(MSG_PEEK) returns > 0 and is_connected()
incorrectly reports true. Add poll(POLLHUP) check before
recv(MSG_PEEK) to detect peer hangup regardless of buffered data.
Fixes spdk#3842
Assisted-by: Cursor
Change-Id: Id5a835a6a3d1ceeac08e17ded2d442c300a176d2
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@nutanix.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/27957
Community-CI: Mellanox Build Bot
Tested-by: SPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: Jim Harris <jim.harris@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>1 parent cc090cd commit b2111a3
2 files changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1768 | 1768 | | |
1769 | 1769 | | |
1770 | 1770 | | |
| 1771 | + | |
1771 | 1772 | | |
1772 | 1773 | | |
1773 | 1774 | | |
1774 | 1775 | | |
1775 | 1776 | | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
1776 | 1784 | | |
1777 | 1785 | | |
1778 | 1786 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1501 | 1501 | | |
1502 | 1502 | | |
1503 | 1503 | | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
1504 | 1512 | | |
1505 | 1513 | | |
1506 | 1514 | | |
| |||
0 commit comments