From 1f5cc259747256b37a0706294328d0d443dea403 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 31 Aug 2022 16:45:15 +0200 Subject: [PATCH] - Fix for wait for udp send to stop when packet is successfully sent. --- doc/Changelog | 1 + util/netevent.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 212df9a88..2ea68e1a2 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -6,6 +6,7 @@ blocking socket operations. - Fix to wait for blocked write on UDP sockets, with a timeout if it takes too long the packet is dropped. + - Fix for wait for udp send to stop when packet is successfully sent. 22 August 2022: Wouter - Fix #741: systemd socket activation fails on IPv6. diff --git a/util/netevent.c b/util/netevent.c index cf9a38f61..9c5fb3af3 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -388,7 +388,7 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, #endif /* if we set the fd blocking, other threads suddenly * have a blocking fd that they operate on */ - while( + while(sent == -1 && ( #ifndef USE_WINSOCK errno == EAGAIN || errno == EINTR || # ifdef EWOULDBLOCK @@ -401,7 +401,7 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, WSAGetLastError() == WSAENOBUFS || WSAGetLastError() == WSAEWOULDBLOCK #endif - ) { + )) { #if defined(HAVE_POLL) || defined(USE_WINSOCK) struct pollfd p; int pret; @@ -624,7 +624,7 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet, WSAGetLastError() == WSAENOBUFS || WSAGetLastError() == WSAEWOULDBLOCK) { #endif - while( + while(sent == -1 && ( #ifndef USE_WINSOCK errno == EAGAIN || errno == EINTR || # ifdef EWOULDBLOCK @@ -637,7 +637,7 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet, WSAGetLastError() == WSAENOBUFS || WSAGetLastError() == WSAEWOULDBLOCK #endif - ) { + )) { #if defined(HAVE_POLL) || defined(USE_WINSOCK) struct pollfd p; int pret; -- 2.47.3