]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- TCP_TIMEOUT is specified in milliseconds.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 15 Jun 2016 14:23:43 +0000 (14:23 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 15 Jun 2016 14:23:43 +0000 (14:23 +0000)
git-svn-id: file:///svn/unbound/trunk@3793 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/remote.h
doc/Changelog
util/netevent.c
util/netevent.h

index b25bfb1af6112e0bdbbb29227bf294628a220e1e..190286d474a4a5da988f63dc5f20f61fbcfc1396 100644 (file)
@@ -56,8 +56,8 @@ struct comm_reply;
 struct comm_point;
 struct daemon_remote;
 
-/** number of seconds timeout on incoming remote control handshake */
-#define REMOTE_CONTROL_TCP_TIMEOUT 120
+/** number of milliseconds timeout on incoming remote control handshake */
+#define REMOTE_CONTROL_TCP_TIMEOUT 120000
 
 /**
  * a busy control command connection, SSL state
index 1db81a4db7ae11502fd958e88643e88a38657dd4..a46715a899b6a8249cfb0252a8fc97c3dd3210a7 100644 (file)
@@ -1,3 +1,6 @@
+15 June 2016: Wouter
+       - TCP_TIMEOUT is specified in milliseconds.
+
 14 June 2016: Ralph
        - QNAME minimisation unit test for dropped QTYPE=A queries.
 
index bdb35739327bc80e97a9db2cfd8caecf00475c74..03a752db3ffeddbeaa9b2f7cbd03ab83ff243b75 100644 (file)
@@ -80,8 +80,8 @@
 #  endif
 #endif
 
-/** The TCP reading or writing query timeout in seconds */
-#define TCP_QUERY_TIMEOUT 120 
+/** The TCP reading or writing query timeout in milliseconds */
+#define TCP_QUERY_TIMEOUT 120000
 
 #ifndef NONBLOCKING_IS_BROKEN
 /** number of UDP reads to perform per read indication from select */
@@ -2009,7 +2009,7 @@ comm_point_stop_listening(struct comm_point* c)
 }
 
 void 
-comm_point_start_listening(struct comm_point* c, int newfd, int sec)
+comm_point_start_listening(struct comm_point* c, int newfd, int msec)
 {
        verbose(VERB_ALGO, "comm point start listening %d", 
                c->fd==-1?newfd:c->fd);
@@ -2017,7 +2017,7 @@ comm_point_start_listening(struct comm_point* c, int newfd, int sec)
                /* no use to start listening no free slots. */
                return;
        }
-       if(sec != -1 && sec != 0) {
+       if(msec != -1 && msec != 0) {
                if(!c->timeout) {
                        c->timeout = (struct timeval*)malloc(sizeof(
                                struct timeval));
@@ -2028,8 +2028,8 @@ comm_point_start_listening(struct comm_point* c, int newfd, int sec)
                }
                ub_event_add_bits(c->ev->ev, UB_EV_TIMEOUT);
 #ifndef S_SPLINT_S /* splint fails on struct timeval. */
-               c->timeout->tv_sec = sec;
-               c->timeout->tv_usec = 0;
+               c->timeout->tv_sec = msec/1000;
+               c->timeout->tv_usec = msec%1000;
 #endif /* S_SPLINT_S */
        }
        if(c->type == comm_tcp) {
@@ -2049,7 +2049,7 @@ comm_point_start_listening(struct comm_point* c, int newfd, int sec)
                c->fd = newfd;
                ub_event_set_fd(c->ev->ev, c->fd);
        }
-       if(ub_event_add(c->ev->ev, sec==0?NULL:c->timeout) != 0) {
+       if(ub_event_add(c->ev->ev, msec==0?NULL:c->timeout) != 0) {
                log_err("event_add failed. in cpsl.");
        }
 }
index bdcddd848bd079cc5d7ec39cd799a22bbb2c1025..b902ab3be2058b41daf6b0c0c802e895b6a1e019 100644 (file)
@@ -496,9 +496,10 @@ void comm_point_stop_listening(struct comm_point* c);
  * Start listening again for input on the comm point.
  * @param c: commpoint to enable again.
  * @param newfd: new fd, or -1 to leave fd be.
- * @param sec: timeout in seconds, or -1 for no (change to the) timeout.
+ * @param msec: timeout in milliseconds, or -1 for no (change to the) timeout.
+ *     So seconds*1000.
  */
-void comm_point_start_listening(struct comm_point* c, int newfd, int sec);
+void comm_point_start_listening(struct comm_point* c, int newfd, int msec);
 
 /**
  * Stop listening and start listening again for reading or writing.