From 3dbd8edc3572947b4da3d6bc6f77ada32df3745f Mon Sep 17 00:00:00 2001 From: Cristian Onet Date: Mon, 27 Jan 2014 11:58:37 +0100 Subject: Fix of 'dbus-daemon can only handle 64 simultaneous connections on Windows'. [Slightly modified by -rh] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71297 Reviewed-by: Ralf Habacker Reviewed-by: Simon McVittie --- cmake/CMakeLists.txt | 4 ++++ cmake/config.h.cmake | 2 ++ configure.ac | 3 +++ 3 files changed, 9 insertions(+) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index fd6c5250..b7c25299 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -107,6 +107,10 @@ option (DBUS_DISABLE_ASSERT "Disable assertion checking" OFF) option (DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF) +if(WIN32) + set(FD_SETSIZE "8192" CACHE STRING "The maximum number of connections that can be handled at once") +endif() + find_package(EXPAT) find_package(X11) find_package(GLib2) diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index 119ed396..bd4cd444 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -196,6 +196,8 @@ /* Define to 1 if you have struct cmsgred */ #cmakedefine HAVE_CMSGCRED 1 +#cmakedefine FD_SETSIZE @FD_SETSIZE@ + // system type defines #if defined(_WIN32) || defined(_WIN64) || defined (_WIN32_WCE) # define DBUS_WIN diff --git a/configure.ac b/configure.ac index 9b320734..1ac18853 100644 --- a/configure.ac +++ b/configure.ac @@ -99,6 +99,9 @@ esac # Special defines for certain platforms if test "$dbus_win" = yes; then AC_DEFINE(DBUS_WIN,1,[Defined if we run on a W32 API based system]) + # Yes, on Windows it really does work like this. + # http://support.microsoft.com/kb/111855 + AC_DEFINE(FD_SETSIZE,8192,[The maximum number of connections that can be handled at once]) BUILD_TIMESTAMP=`date --iso-8601=minutes` AC_SUBST(BUILD_TIMESTAMP) # Assume DBUS_VERSION is always three numbers -- cgit v1.2.3