Skip to content

Commit b0d20e2

Browse files
committed
- Fix #1251: WSAPoll first argument cannot be NULL.
1 parent 13afde2 commit b0d20e2

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

doc/Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
18 March 2025: Wouter
2+
- Fix #1251: WSAPoll first argument cannot be NULL.
3+
14
17 March 2025: Wouter
25
- Fix representation of types GPOS and RESINFO, add rdf type for
36
unquoted str.

util/netevent.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,11 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet,
442442
int pret;
443443
memset(&p, 0, sizeof(p));
444444
p.fd = c->fd;
445-
p.events = POLLOUT | POLLERR | POLLHUP;
445+
p.events = POLLOUT | POLLERR
446+
#ifndef USE_WINSOCK
447+
| POLLHUP
448+
#endif
449+
;
446450
# ifndef USE_WINSOCK
447451
pret = poll(&p, 1, SEND_BLOCKED_WAIT_TIMEOUT);
448452
# else
@@ -496,7 +500,8 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet,
496500
#ifndef USE_WINSOCK
497501
pret = poll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
498502
#else
499-
pret = WSAPoll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
503+
Sleep((SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
504+
pret = 0;
500505
#endif
501506
if(pret < 0 &&
502507
#ifndef USE_WINSOCK
@@ -751,7 +756,11 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet,
751756
int pret;
752757
memset(&p, 0, sizeof(p));
753758
p.fd = c->fd;
754-
p.events = POLLOUT | POLLERR | POLLHUP;
759+
p.events = POLLOUT | POLLERR
760+
#ifndef USE_WINSOCK
761+
| POLLHUP
762+
#endif
763+
;
755764
# ifndef USE_WINSOCK
756765
pret = poll(&p, 1, SEND_BLOCKED_WAIT_TIMEOUT);
757766
# else
@@ -805,7 +814,8 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet,
805814
#ifndef USE_WINSOCK
806815
pret = poll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
807816
#else
808-
pret = WSAPoll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
817+
Sleep((SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1));
818+
pret = 0;
809819
#endif
810820
if(pret < 0 &&
811821
#ifndef USE_WINSOCK

0 commit comments

Comments
 (0)