diff --git a/CHANGES b/CHANGES index ade0cdc751..a4350e8508 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ --- 9.10.0a2 released --- +3724. [bug] win32: Fixed a bug that prevented dig and + host from exiting properly after completing + a UDP query. [RT #35288] + 3723. [cleanup] Imported keys are now handled the same way regardless of DNSSEC algorithm. [RT #35215] diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c index c93ff8a4f6..11903eddf2 100644 --- a/lib/isc/win32/socket.c +++ b/lib/isc/win32/socket.c @@ -1402,7 +1402,7 @@ startio_send(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes, *nbytes = internal_sendmsg(sock, lpo, msghdr, 0, send_errno); - if (*nbytes < 0) { + if (*nbytes <= 0) { /* * I/O has been initiated * completion will be through the completion port @@ -3003,13 +3003,14 @@ socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, io_state = startio_send(sock, dev, &cc, &send_errno); switch (io_state) { - case DOIO_PENDING: /* I/O started. Nothing more to do */ + case DOIO_PENDING: /* I/O started. Enqueue completion event. */ case DOIO_SOFT: /* * We couldn't send all or part of the request right now, so * queue it unless ISC_SOCKFLAG_NORETRY is set. */ - if ((flags & ISC_SOCKFLAG_NORETRY) == 0) { + if ((flags & ISC_SOCKFLAG_NORETRY) == 0 || + io_state == DOIO_PENDING) { isc_task_attach(task, &ntask); dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;