]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #1251: WSAPoll first argument cannot be NULL.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 18 Mar 2025 12:59:53 +0000 (13:59 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 18 Mar 2025 12:59:53 +0000 (13:59 +0100)
doc/Changelog
util/netevent.c

index 912faef122960e3a4ae358ac23af4a15be1b84bb..697f0273dd58ddb6d9203dcadada78f66b430513 100644 (file)
@@ -1,3 +1,6 @@
+18 March 2025: Wouter
+       - Fix #1251: WSAPoll first argument cannot be NULL.
+
 17 March 2025: Wouter
        - Fix representation of types GPOS and RESINFO, add rdf type for
          unquoted str.
index 8f64278c3e79ff6e0bf6abbba08a59ac64313675..9987758039aa409c9955d86d7ddfe9d47524f84b 100644 (file)
@@ -442,7 +442,11 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet,
                                int pret;
                                memset(&p, 0, sizeof(p));
                                p.fd = c->fd;
-                               p.events = POLLOUT | POLLERR | POLLHUP;
+                               p.events = POLLOUT | POLLERR
+#ifndef USE_WINSOCK
+                                       | POLLHUP
+#endif
+                                       ;
 #  ifndef USE_WINSOCK
                                pret = poll(&p, 1, SEND_BLOCKED_WAIT_TIMEOUT);
 #  else
@@ -496,7 +500,8 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet,
 #ifndef USE_WINSOCK
                                        pret = poll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
 #else
-                                       pret = WSAPoll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
+                                       Sleep((SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
+                                       pret = 0;
 #endif
                                        if(pret < 0 &&
 #ifndef USE_WINSOCK
@@ -751,7 +756,11 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet,
                                int pret;
                                memset(&p, 0, sizeof(p));
                                p.fd = c->fd;
-                               p.events = POLLOUT | POLLERR | POLLHUP;
+                               p.events = POLLOUT | POLLERR
+#ifndef USE_WINSOCK
+                                       | POLLHUP
+#endif
+                                       ;
 #  ifndef USE_WINSOCK
                                pret = poll(&p, 1, SEND_BLOCKED_WAIT_TIMEOUT);
 #  else
@@ -805,7 +814,8 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet,
 #ifndef USE_WINSOCK
                                        pret = poll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
 #else
-                                       pret = WSAPoll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
+                                       Sleep((SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
+                                       pret = 0;
 #endif
                                        if(pret < 0 &&
 #ifndef USE_WINSOCK