mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-14 00:03:58 -05:00
dnstap io, fix event reference in winevent wouldblock call.
This commit is contained in:
parent
522fcccea2
commit
8f2f004778
2 changed files with 9 additions and 4 deletions
|
|
@ -506,7 +506,7 @@ static int dtio_check_nb_connect(struct dt_io_thread* dtio)
|
|||
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
|
||||
|
|
@ -555,7 +555,7 @@ static int dtio_write_buf(struct dt_io_thread* dtio, uint8_t* buf,
|
|||
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",
|
||||
|
|
@ -600,7 +600,7 @@ static int dtio_write_with_writev(struct dt_io_thread* dtio)
|
|||
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",
|
||||
|
|
@ -720,7 +720,7 @@ static int dtio_check_close(struct dt_io_thread* dtio)
|
|||
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
|
||||
|
|
@ -1098,6 +1098,7 @@ static void dtio_control_stop_flush(struct dt_io_thread* dtio)
|
|||
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");
|
||||
|
|
@ -1107,6 +1108,7 @@ static void dtio_control_stop_flush(struct dt_io_thread* dtio)
|
|||
}
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -133,6 +133,9 @@ struct dt_io_thread {
|
|||
/** the io thread wants to exit */
|
||||
int want_to_exit;
|
||||
|
||||
/** in stop flush, this is nonNULL and references the stop_ev */
|
||||
void* stop_flush_event;
|
||||
|
||||
/** the timer event for connection retries */
|
||||
void* reconnect_timer;
|
||||
/** if the reconnect timer is added to the event base */
|
||||
|
|
|
|||
Loading…
Reference in a new issue