]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] fixed win32 dig problem
authorEvan Hunt <each@isc.org>
Tue, 4 Feb 2014 20:01:20 +0000 (12:01 -0800)
committerMark Andrews <marka@isc.org>
Wed, 5 Feb 2014 01:45:14 +0000 (12:45 +1100)
3724.   [bug]           win32: Fixed a bug that prevented dig and
                        host from exiting properly after completing
                        a UDP query. [RT #35288]

(cherry picked from commit a8cdf2a2e7e9a716a94db550138f1a65000fc19f)

CHANGES
lib/isc/win32/socket.c

diff --git a/CHANGES b/CHANGES
index 6054ae831d32f6cffd62c2eff07e9c3a71f28d7a..e5a212c4b95d2801c808c3447f66a3634b9c01c0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+3724.  [bug]           win32: Fixed a bug that prevented dig and
+                       host from exiting properly after completing
+                       a UDP query. [RT #35288]
+
        --- 9.8.7 released ---
 
        --- 9.8.7rc2 released ---
index 2bef3fa66e319f5310bc9cb4b3672cf641884e0b..44622f4a5a450c8d0ff00dba7e23dffe03b4c91c 100644 (file)
@@ -1390,7 +1390,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
@@ -2945,13 +2945,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;