Skip to content

Commit bf819fc

Browse files
committed
issue: 1792164 Support checking POLLERR events by poll()
Signed-off-by: Igor Ivanov <[email protected]>
1 parent 1c55b91 commit bf819fc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/vma/iomux/poll_call.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ poll_call::poll_call(int *off_rfds_buffer, offloaded_mode_t *off_modes_buffer, i
7171
socket_fd_api* temp_sock_fd_api = fd_collection_get_sockfd(fd);
7272
if (temp_sock_fd_api && (temp_sock_fd_api->get_type()==FD_TYPE_SOCKET)) {
7373
offloaded_mode_t off_mode = OFF_NONE;
74-
if (m_orig_fds[i].events & POLLIN)
74+
if (m_orig_fds[i].events & (POLLIN | POLLERR | POLLHUP))
7575
off_mode = (offloaded_mode_t)(off_mode | OFF_READ);
7676
if (m_orig_fds[i].events & POLLOUT)
7777
off_mode = (offloaded_mode_t)(off_mode | OFF_WRITE);

src/vma/sock/sockinfo_tcp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3329,7 +3329,8 @@ bool sockinfo_tcp::is_errorable(int *errors)
33293329
*errors |= POLLHUP;
33303330
}
33313331

3332-
if (m_conn_state == TCP_CONN_ERROR) {
3332+
if ((m_conn_state == TCP_CONN_ERROR) ||
3333+
(!m_error_queue.empty())) {
33333334
*errors |= POLLERR;
33343335
}
33353336

0 commit comments

Comments
 (0)