]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix tcp timeouts in tv.usec.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 16 Jun 2016 07:21:07 +0000 (07:21 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 16 Jun 2016 07:21:07 +0000 (07:21 +0000)
git-svn-id: file:///svn/unbound/trunk@3795 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/netevent.c

index 135a92fe415d2164acba36a517b30bf9d25c077f..91bc76fb373a85c41dffa8357d06262f62914f96 100644 (file)
@@ -1,3 +1,6 @@
+16 June 2016: Wouter
+       - Fix tcp timeouts in tv.usec.
+
 15 June 2016: Wouter
        - TCP_TIMEOUT is specified in milliseconds.
        - If more than half of tcp connections are in use, a shorter timeout
index f0918ecd6d63d2995fa2e32776b6bdf98b3c50a8..a9340f3e2162e62879d1c42e243ebb0394b34b6d 100644 (file)
@@ -777,7 +777,7 @@ int comm_point_perform_accept(struct comm_point* c,
                                (*b->stop_accept)(b->cb_arg);
                                /* set timeout, no mallocs */
                                tv.tv_sec = NETEVENT_SLOW_ACCEPT_TIME/1000;
-                               tv.tv_usec = NETEVENT_SLOW_ACCEPT_TIME%1000;
+                               tv.tv_usec = (NETEVENT_SLOW_ACCEPT_TIME%1000)*1000;
                                b->eb->slow_accept = ub_event_new(b->eb->base,
                                        -1, UB_EV_TIMEOUT,
                                        comm_base_handle_slow_accept, b);
@@ -2038,7 +2038,7 @@ comm_point_start_listening(struct comm_point* c, int newfd, int msec)
                ub_event_add_bits(c->ev->ev, UB_EV_TIMEOUT);
 #ifndef S_SPLINT_S /* splint fails on struct timeval. */
                c->timeout->tv_sec = msec/1000;
-               c->timeout->tv_usec = msec%1000;
+               c->timeout->tv_usec = (msec%1000)*1000;
 #endif /* S_SPLINT_S */
        }
        if(c->type == comm_tcp) {