o Make EV_PERSIST timeouts more accurate: schedule the next event based on the scheduled time of the previous event, not based on the current time.
o Allow http.c to handle cases where getaddrinfo returns an IPv6 address. Patch from Ryan Phillips.
o Fix a problem with excessive memory allocation when using multiple event priorities.
+ o Default to using arc4random for DNS transaction IDs on systems that have it.
Changes in 2.0.2-alpha:
AC_HEADER_TIME
dnl Checks for library functions.
-AC_CHECK_FUNCS(gettimeofday vasprintf fcntl clock_gettime strtok_r strsep getaddrinfo getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice)
+AC_CHECK_FUNCS(gettimeofday vasprintf fcntl clock_gettime strtok_r strsep getaddrinfo getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random)
AC_CHECK_SIZEOF(long)
-if test "x$ac_cv_func_clock_gettime" = "xyes"; then
- AC_DEFINE(DNS_USE_CPU_CLOCK_FOR_ID, 1, [Define if clock_gettime is available in libc])
+if test "x$ac_cv_func_arc4random" = "xyes" ; then
+ AC_DEFINE(DNS_USE_ARC4RANDOM_FOR_ID, 1, [Define if we should use arc4random to generate dns transation IDs])
+elif test "x$ac_cv_func_clock_gettime" = "xyes"; then
+ AC_DEFINE(DNS_USE_CPU_CLOCK_FOR_ID, 1, [Define if we should use clock_gettime to generate dns transation IDs])
else
- AC_DEFINE(DNS_USE_GETTIMEOFDAY_FOR_ID, 1, [Define is no secure id variant is available])
+ AC_DEFINE(DNS_USE_GETTIMEOFDAY_FOR_ID, 1, [Define if s no secure id variant is available])
fi
AC_MSG_CHECKING(for F_SETFD in fcntl.h)
#ifndef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID
#ifndef _EVENT_DNS_USE_OPENSSL_FOR_ID
#ifndef _EVENT_DNS_USE_FTIME_FOR_ID
+#ifndef _EVENT_DNS_USE_ARC4RANDOM_FOR_ID
#error Must configure at least one id generation method.
#error Please see the documentation.
#endif
#endif
#endif
#endif
+#endif
/* #define _POSIX_C_SOURCE 200507 */
#define _GNU_SOURCE
abort();
}
#endif
+
+#ifdef _EVENT_DNS_USE_ARC4RANDOM_FOR_ID
+ trans_id = arc4random() & 0xffff;
+#endif
+
return trans_id;
}