]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
dnstap io, nicer layout for wouldblock calls.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 23 Jan 2020 15:51:57 +0000 (16:51 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 23 Jan 2020 15:51:57 +0000 (16:51 +0100)
dnstap/dtstream.c

index 8a4eefbf2963c6aa75bf90bc71037e521dce9ff1..a62de0a637d51211078fce7f2c114c68eefefe9e 100644 (file)
@@ -506,7 +506,8 @@ static int dtio_check_nb_connect(struct dt_io_thread* dtio)
        if(error == WSAEINPROGRESS) {
                return 0; /* try again later */
        } else if(error == WSAEWOULDBLOCK) {
-               ub_winsock_tcp_wouldblock((dtio->stop_flush_event?dtio->stop_flush_event:dtio->event), UB_EV_WRITE);
+               ub_winsock_tcp_wouldblock((dtio->stop_flush_event?
+                       dtio->stop_flush_event:dtio->event), UB_EV_WRITE);
                return 0; /* try again later */
        }
 #endif
@@ -555,7 +556,9 @@ static int dtio_write_buf(struct dt_io_thread* dtio, uint8_t* buf,
                if(WSAGetLastError() == WSAEINPROGRESS)
                        return 0;
                if(WSAGetLastError() == WSAEWOULDBLOCK) {
-                       ub_winsock_tcp_wouldblock((dtio->stop_flush_event?dtio->stop_flush_event:dtio->event), UB_EV_WRITE);
+                       ub_winsock_tcp_wouldblock((dtio->stop_flush_event?
+                               dtio->stop_flush_event:dtio->event),
+                               UB_EV_WRITE);
                        return 0;
                }
                log_err("dnstap io: failed send: %s",
@@ -600,7 +603,9 @@ static int dtio_write_with_writev(struct dt_io_thread* dtio)
                if(WSAGetLastError() == WSAEINPROGRESS)
                        return 0;
                if(WSAGetLastError() == WSAEWOULDBLOCK) {
-                       ub_winsock_tcp_wouldblock((dtio->stop_flush_event?dtio->stop_flush_event:dtio->event), UB_EV_WRITE);
+                       ub_winsock_tcp_wouldblock((dtio->stop_flush_event?
+                               dtio->stop_flush_event:dtio->event),
+                               UB_EV_WRITE);
                        return 0;
                }
                log_err("dnstap io: failed writev: %s",
@@ -720,7 +725,10 @@ static int dtio_check_close(struct dt_io_thread* dtio)
                        if(WSAGetLastError() == WSAEINPROGRESS) {
                                return 1; /* try later */
                        } else if(WSAGetLastError() == WSAEWOULDBLOCK) {
-                               ub_winsock_tcp_wouldblock((dtio->stop_flush_event?dtio->stop_flush_event:dtio->event), UB_EV_READ);
+                               ub_winsock_tcp_wouldblock(
+                                       (dtio->stop_flush_event?
+                                       dtio->stop_flush_event:dtio->event),
+                                       UB_EV_READ);
                                return 1; /* try later */
                        }
 #endif