chiark / gitweb /
Retransmission and timeout work now !
[adns.git] / src / internal.h
index b652f2304903d4cd4c44d0e8bfb5d80643136ef7..5b5097b7ed6b21abd81872621f67f254d5e24721 100644 (file)
@@ -17,7 +17,7 @@ typedef unsigned char byte;
 /* Configuration and constants */
 
 #define MAXSERVERS 5
-#define MAXUDPRETRIES 15
+#define MAXUDPRETRIES /*15*/5
 #define UDPRETRYMS 2000
 #define TCPMS 30000
 #define LOCALRESOURCEMS 20
@@ -175,9 +175,9 @@ static inline void timevaladd(struct timeval *tv_io, long ms) {
   struct timeval tmp;
   assert(ms>=0);
   tmp= *tv_io;
-  tmp.tv_usec += (ms%1000)*1000;
+  tmp.tv_usec += (ms%1000)*1000000;
   tmp.tv_sec += ms/1000;
-  if (tmp.tv_usec >= 1000) { tmp.tv_sec++; tmp.tv_usec -= 1000; }
+  if (tmp.tv_usec >= 1000000) { tmp.tv_sec++; tmp.tv_usec -= 1000; }
   *tv_io= tmp;
 }