- Fix for wait for udp send to stop when packet is successfully sent.

This commit is contained in:
W.C.A. Wijngaards 2022-08-31 16:45:15 +02:00
parent ec5812a748
commit 1f5cc25974
2 changed files with 5 additions and 4 deletions

View file

@ -6,6 +6,7 @@
blocking socket operations. blocking socket operations.
- Fix to wait for blocked write on UDP sockets, with a timeout if it - Fix to wait for blocked write on UDP sockets, with a timeout if it
takes too long the packet is dropped. takes too long the packet is dropped.
- Fix for wait for udp send to stop when packet is successfully sent.
22 August 2022: Wouter 22 August 2022: Wouter
- Fix #741: systemd socket activation fails on IPv6. - Fix #741: systemd socket activation fails on IPv6.

View file

@ -388,7 +388,7 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet,
#endif #endif
/* if we set the fd blocking, other threads suddenly /* if we set the fd blocking, other threads suddenly
* have a blocking fd that they operate on */ * have a blocking fd that they operate on */
while( while(sent == -1 && (
#ifndef USE_WINSOCK #ifndef USE_WINSOCK
errno == EAGAIN || errno == EINTR || errno == EAGAIN || errno == EINTR ||
# ifdef EWOULDBLOCK # ifdef EWOULDBLOCK
@ -401,7 +401,7 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet,
WSAGetLastError() == WSAENOBUFS || WSAGetLastError() == WSAENOBUFS ||
WSAGetLastError() == WSAEWOULDBLOCK WSAGetLastError() == WSAEWOULDBLOCK
#endif #endif
) { )) {
#if defined(HAVE_POLL) || defined(USE_WINSOCK) #if defined(HAVE_POLL) || defined(USE_WINSOCK)
struct pollfd p; struct pollfd p;
int pret; int pret;
@ -624,7 +624,7 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet,
WSAGetLastError() == WSAENOBUFS || WSAGetLastError() == WSAENOBUFS ||
WSAGetLastError() == WSAEWOULDBLOCK) { WSAGetLastError() == WSAEWOULDBLOCK) {
#endif #endif
while( while(sent == -1 && (
#ifndef USE_WINSOCK #ifndef USE_WINSOCK
errno == EAGAIN || errno == EINTR || errno == EAGAIN || errno == EINTR ||
# ifdef EWOULDBLOCK # ifdef EWOULDBLOCK
@ -637,7 +637,7 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet,
WSAGetLastError() == WSAENOBUFS || WSAGetLastError() == WSAENOBUFS ||
WSAGetLastError() == WSAEWOULDBLOCK WSAGetLastError() == WSAEWOULDBLOCK
#endif #endif
) { )) {
#if defined(HAVE_POLL) || defined(USE_WINSOCK) #if defined(HAVE_POLL) || defined(USE_WINSOCK)
struct pollfd p; struct pollfd p;
int pret; int pret;