]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4219. [bug] Set event->result to ISC_R_WOULDBLOCK on EWOULDBLOCK,
authorMark Andrews <marka@isc.org>
Mon, 21 Sep 2015 07:22:53 +0000 (17:22 +1000)
committerMark Andrews <marka@isc.org>
Mon, 21 Sep 2015 07:22:53 +0000 (17:22 +1000)
                        EGAIN when these soft error are not retried for
                        isc_socket_send*().

CHANGES
lib/isc/include/isc/result.h
lib/isc/result.c
lib/isc/unix/socket.c

diff --git a/CHANGES b/CHANGES
index 627dcb77533c69d9c10de337417322c6c0e5254c..5abde3fc7d8385a6ece8bfa871f9dc3335e6d0d4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+4219.  [bug]           Set event->result to ISC_R_WOULDBLOCK on EWOULDBLOCK,
+                       EGAIN when these soft error are not retried for
+                       isc_socket_send*().
+
 4218.  [bug]           Potential null pointer dereference on out of memory
                        if mmap is not supported. [RT #40777]
 
index b1d351dcb5ab154af4bb67e9580e05d110cd25ed..e52c058909afe1b9d224df6f3c5102bd870137d7 100644 (file)
 #define ISC_R_BADBASE32                        60      /*%< bad base32 encoding */
 #define ISC_R_UNSET                    61      /*%< unset */
 #define ISC_R_MULTIPLE                 62      /*%< multiple */
+#define ISC_R_WOULDBLOCK               63      /*%< would block */
 
 /*% Not a result code: the number of results. */
-#define ISC_R_NRESULTS                         63
+#define ISC_R_NRESULTS                         64
 
 ISC_LANG_BEGINDECLS
 
index d6bbad7a6d666259629e0ccec6a2c0342cbf0567..854ff413b11cb42d132903ed40070fcb90c9b2a0 100644 (file)
@@ -104,6 +104,7 @@ static const char *description[ISC_R_NRESULTS] = {
        "bad base32 encoding",                  /*%< 60 */
        "unset",                                /*%< 61 */
        "multiple",                             /*%< 62 */
+       "would block",                          /*%< 63 */
 };
 
 static const char *identifier[ISC_R_NRESULTS] = {
@@ -170,6 +171,7 @@ static const char *identifier[ISC_R_NRESULTS] = {
        "ISC_R_BADBASE32",
        "ISC_R_UNSET",
        "ISC_R_MULTIPLE",
+       "ISC_R_WOULDBLOCK",
 };
 
 #define ISC_RESULT_RESULTSET                   2
index ad7aa5fef9dcb5dda25abdf192b7899de7861535..ea009134c5ec4dfc8fc60a0bdc24bfd6d531c643 100644 (file)
@@ -2054,8 +2054,11 @@ doio_send(isc__socket_t *sock, isc_socketevent_t *dev) {
                if (send_errno == EINTR && ++attempts < NRETRIES)
                        goto resend;
 
-               if (SOFT_ERROR(send_errno))
+               if (SOFT_ERROR(send_errno)) {
+                       if (errno == EWOULDBLOCK || errno == EAGAIN)
+                               dev->result = ISC_R_WOULDBLOCK;
                        return (DOIO_SOFT);
+               }
 
 #define SOFT_OR_HARD(_system, _isc) \
        if (send_errno == _system) { \