Merge branch 'develop' into features/conversion_functions

This commit is contained in:
Willem Toorop 2015-12-16 13:53:25 +01:00
commit 16b62f43eb
2 changed files with 32 additions and 23 deletions

View File

@ -163,29 +163,22 @@ case "$enable_debug_sec" in
;; ;;
esac esac
AC_ARG_ENABLE(tcp-fastopen, AC_HELP_STRING([--enable-tcp-fastopen], [Enable TCP Fast Open])) AC_ARG_ENABLE(tcp-fastopen, AC_HELP_STRING([--disable-tcp-fastopen], Disable TCP Fast Open (default=enabled if available)),
case "$enable_tcp_fastopen" in enable_tcp_fastopen="$enableval", enable_tcp_fastopen=yes)
yes) if test "x$enable_tcp_fastopen" = xno; then
AC_CHECK_DECL([MSG_FASTOPEN], [], [AC_MSG_ERROR([TCP Fast Open is not available: please rerun without --enable-tcp-fastopen])], [AC_INCLUDES_DEFAULT AC_MSG_WARN([TCP Fast Open is disabled])
#include <sys/socket.h> else
]) case `uname` in
AC_DEFINE_UNQUOTED([USE_TCP_FASTOPEN], [1], [Define this to enable TCP fast open.]) Linux) AC_CHECK_DECL([MSG_FASTOPEN], [AC_DEFINE_UNQUOTED([USE_TCP_FASTOPEN], [1], [Define this to enable TCP fast open.])],
[AC_MSG_WARN([TCP Fast Open is not available, continuing without])], [#include <sys/socket.h>])
;; ;;
no|*) Darwin) AC_CHECK_DECL([CONNECT_RESUME_ON_READ_WRITE], [AC_DEFINE_UNQUOTED([USE_OSX_TCP_FASTOPEN], [1], [Define this to enable TCP fast open.])],
[AC_MSG_WARN([TCP Fast Open is not available, continuing without])], [#include <sys/socket.h>])
;;
*) AC_MSG_WARN([TCP Fast Open is not available, continuing without])
;; ;;
esac esac
fi
# Not yet enabled by default as crash found when TCP fails.
# AC_ARG_ENABLE(tcp-fastopen, AC_HELP_STRING([--disable-tcp-fastopen], Disable TCP Fast Open (default=enabled if available)),
# enable_tcp_fastopen="$enableval", enable_tcp_fastopen=yes)
# if test "x$enable_tcp_fastopen" = xno; then
# AC_MSG_WARN([TCP Fast Open is disabled])
# else
# AC_CHECK_DECL([MSG_FASTOPEN], [AC_DEFINE_UNQUOTED([USE_TCP_FASTOPEN], [1], [Define this to enable TCP fast open.])],
# [AC_MSG_WARN([TCP Fast Open is not available.])], [AC_INCLUDES_DEFAULT
# #include <sys/socket.h>
# ])
# fi
AC_ARG_ENABLE(native-stub-dnssec, AC_HELP_STRING([--disable-native-stub-dnssec], [Disable native stub DNSSEC support])) AC_ARG_ENABLE(native-stub-dnssec, AC_HELP_STRING([--disable-native-stub-dnssec], [Disable native stub DNSSEC support]))
case "$enable_native_stub_dnssec" in case "$enable_native_stub_dnssec" in

View File

@ -363,6 +363,22 @@ tcp_connect(getdns_upstream *upstream, getdns_transport_list_t transport)
if (transport == GETDNS_TRANSPORT_TCP || if (transport == GETDNS_TRANSPORT_TCP ||
transport == GETDNS_TRANSPORT_STARTTLS) transport == GETDNS_TRANSPORT_STARTTLS)
return fd; return fd;
#elif USE_OSX_TCP_FASTOPEN
sa_endpoints_t endpoints;
endpoints.sae_srcif = 0;
endpoints.sae_srcaddr = NULL;
endpoints.sae_srcaddrlen = 0;
endpoints.sae_dstaddr = (struct sockaddr *)&upstream->addr;
endpoints.sae_dstaddrlen = upstream->addr_len;
if (connectx(fd, &endpoints, SAE_ASSOCID_ANY,
CONNECT_DATA_IDEMPOTENT | CONNECT_RESUME_ON_READ_WRITE,
NULL, 0, NULL, NULL) == -1) {
if (errno != EINPROGRESS) {
close(fd);
return -1;
}
}
return fd;
#endif #endif
if (connect(fd, (struct sockaddr *)&upstream->addr, if (connect(fd, (struct sockaddr *)&upstream->addr,
upstream->addr_len) == -1) { upstream->addr_len) == -1) {