Skip to content
Snippets Groups Projects
Commit 6e0ccae6 authored by dmitriy.gerasimov's avatar dmitriy.gerasimov
Browse files

Merge branch 'bugs-4073' into 'master'

Some epolling issues

See merge request !134
parents e2fc7365 3fffb232
No related branches found
No related tags found
1 merge request!134Some epolling issues
Pipeline #4061 passed with stage
in 11 seconds
...@@ -517,9 +517,20 @@ static void read_write_cb( dap_client_remote_t *dap_cur, int32_t revents ) ...@@ -517,9 +517,20 @@ static void read_write_cb( dap_client_remote_t *dap_cur, int32_t revents )
dap_cur->buf_out_size - total_sent, dap_cur->buf_out_size - total_sent,
MSG_DONTWAIT | MSG_NOSIGNAL ); MSG_DONTWAIT | MSG_NOSIGNAL );
if( bytes_sent < 0 ) { if( bytes_sent < 0 ) {
log_it(L_ERROR,"[THREAD %u] Error occured in send() function %s", dap_cur->tn, strerror(errno) ); if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
dap_cur->flags |= DAP_SOCK_SIGNAL_CLOSE; dap_cur->pevent.events = EPOLLOUT | EPOLLERR;
break; if( epoll_ctl(dap_cur->efd, EPOLL_CTL_MOD, dap_cur->socket, &dap_cur->pevent) != 0 ) {
log_it( L_ERROR, "epoll_ctl failed..." );
dap_cur->flags |= DAP_SOCK_SIGNAL_CLOSE;
break;
} else {
log_it( L_INFO, "wait for available space in buff..." );
}
} else {
log_it(L_ERROR,"[THREAD %u] Error occured in send() function %s", dap_cur->tn, strerror(errno) );
dap_cur->flags |= DAP_SOCK_SIGNAL_CLOSE;
break;
}
} }
total_sent += (size_t)bytes_sent; total_sent += (size_t)bytes_sent;
...@@ -684,9 +695,7 @@ void *thread_loop( void *arg ) ...@@ -684,9 +695,7 @@ void *thread_loop( void *arg )
log_it( L_ERROR,"Socket error: %u, remove it" , dap_cur->socket ); log_it( L_ERROR,"Socket error: %u, remove it" , dap_cur->socket );
dap_cur->flags |= DAP_SOCK_SIGNAL_CLOSE; dap_cur->flags |= DAP_SOCK_SIGNAL_CLOSE;
} }
#ifdef _WIN32 set_nonblock_socket(dap_cur->socket);
set_nonblock_socket(dap_cur->socket); // pconst: for winsock2 has no appropriate MSG attributes
#endif
if ( !(dap_cur->flags & DAP_SOCK_SIGNAL_CLOSE) || dap_cur->no_close ) if ( !(dap_cur->flags & DAP_SOCK_SIGNAL_CLOSE) || dap_cur->no_close )
read_write_cb( dap_cur, events[i].events ); read_write_cb( dap_cur, events[i].events );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment