Skip to content

Commit

Permalink
issue: 1792164 Support checking POLLERR events by poll()
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Ivanov <[email protected]>
  • Loading branch information
igor-ivanov committed Jul 1, 2020
1 parent af63e14 commit fdc9e75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vma/iomux/poll_call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ poll_call::poll_call(int *off_rfds_buffer, offloaded_mode_t *off_modes_buffer, i
socket_fd_api* temp_sock_fd_api = fd_collection_get_sockfd(fd);
if (temp_sock_fd_api && (temp_sock_fd_api->get_type()==FD_TYPE_SOCKET)) {
offloaded_mode_t off_mode = OFF_NONE;
if (m_orig_fds[i].events & POLLIN)
if (m_orig_fds[i].events & (POLLIN | POLLERR | POLLHUP))
off_mode = (offloaded_mode_t)(off_mode | OFF_READ);
if (m_orig_fds[i].events & POLLOUT)
off_mode = (offloaded_mode_t)(off_mode | OFF_WRITE);
Expand Down
3 changes: 2 additions & 1 deletion src/vma/sock/sockinfo_tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3330,7 +3330,8 @@ bool sockinfo_tcp::is_errorable(int *errors)
*errors |= POLLHUP;
}

if (m_conn_state == TCP_CONN_ERROR) {
if ((m_conn_state == TCP_CONN_ERROR) ||
(!m_error_queue.empty())) {
*errors |= POLLERR;
}

Expand Down

0 comments on commit fdc9e75

Please sign in to comment.