Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libtorrent: Disable UDNS by default #36

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 14 additions & 22 deletions libtorrent/scripts/udns.m4
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
# dnl function for enabling/disabling udns support
AC_DEFUN([TORRENT_WITH_UDNS], [
AC_ARG_WITH(
[udns],
AS_HELP_STRING([--without-udns], [Don't use udns, falling back to synchronous DNS resolution.])
)
# dnl neither ubuntu nor fedora ships a pkgconfig file for udns
AS_IF(
[test "x$with_udns" != "xno"],
[AC_CHECK_HEADERS([udns.h], [have_udns=yes], [have_udns=no])],
[have_udns=no]
)
AS_IF(
[test "x$have_udns" = "xyes"],
AC_ARG_ENABLE(udns,
AC_HELP_STRING([--enable-udns], [use udns instead of synchronous DNS resolution [[default=check]]]),
[
AC_DEFINE(USE_UDNS, 1, Define to build with udns support.)
LIBS="$LIBS -ludns"
],
[
AS_IF(
[test "x$with_udns" = "xyes"],
[AC_MSG_ERROR([udns requested but not found])]
)
]
)
if test "$enableval" = "yes"; then
AC_CHECK_HEADERS([udns.h], [have_udns=yes], [have_udns=no])

if test "$have_udns" = "yes"; then
AC_DEFINE(USE_UDNS, 1, Define to build with udns support.)
LIBS="$LIBS -ludns"

else
AC_MSG_ERROR([udns requested but not found])
fi
fi
])
])
2 changes: 1 addition & 1 deletion libtorrent/src/utils/udnsevent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void a4_callback_wrapper(struct ::dns_ctx *ctx, ::dns_rr_a4 *result, void *data)
if (query->a6_query != NULL) {
::dns_cancel(ctx, query->a6_query);
}
if (*query->callback) { (*query->callback)(reinterpret_cast<sockaddr_in*>(&sa), 0); }
if (*query->callback) { (*query->callback)(reinterpret_cast<sockaddr*>(&sa), 0); }
delete query;
}
}
Expand Down
Loading