if(error == WSAEINPROGRESS) {
return 0; /* try again later */
} else if(error == WSAEWOULDBLOCK) {
- ub_winsock_tcp_wouldblock(dtio->event, UB_EV_WRITE);
+ ub_winsock_tcp_wouldblock((dtio->stop_flush_event?dtio->stop_flush_event:dtio->event), UB_EV_WRITE);
return 0; /* try again later */
}
#endif
if(WSAGetLastError() == WSAEINPROGRESS)
return 0;
if(WSAGetLastError() == WSAEWOULDBLOCK) {
- ub_winsock_tcp_wouldblock(dtio->event, UB_EV_WRITE);
+ ub_winsock_tcp_wouldblock((dtio->stop_flush_event?dtio->stop_flush_event:dtio->event), UB_EV_WRITE);
return 0;
}
log_err("dnstap io: failed send: %s",
if(WSAGetLastError() == WSAEINPROGRESS)
return 0;
if(WSAGetLastError() == WSAEWOULDBLOCK) {
- ub_winsock_tcp_wouldblock(dtio->event, UB_EV_WRITE);
+ ub_winsock_tcp_wouldblock((dtio->stop_flush_event?dtio->stop_flush_event:dtio->event), UB_EV_WRITE);
return 0;
}
log_err("dnstap io: failed writev: %s",
if(WSAGetLastError() == WSAEINPROGRESS) {
return 1; /* try later */
} else if(WSAGetLastError() == WSAEWOULDBLOCK) {
- ub_winsock_tcp_wouldblock(dtio->event, UB_EV_READ);
+ ub_winsock_tcp_wouldblock((dtio->stop_flush_event?dtio->stop_flush_event:dtio->event), UB_EV_READ);
return 1; /* try later */
}
#endif
ub_event_base_free(info.base);
return;
}
+ dtio->stop_flush_event = stopev;
/* wait briefly, or until finished */
verbose(VERB_ALGO, "dnstap io: stop flush started");
}
verbose(VERB_ALGO, "dnstap io: stop flush ended");
free(info.stop_frame);
+ dtio->stop_flush_event = NULL;
ub_event_del(stopev);
ub_event_free(stopev);
ub_timer_del(timer);