print "no\n";
}
-printf "Checking if a TCP deferring mechanism is available... ";
-if (test_file($config{CXX}, "tcp_defer_accept.cpp")) {
- $config{HAS_DEFER} = "TCP_DEFER_ACCEPT";
- print "yes (TCP_DEFER_ACCEPT)\n";
-} elsif (test_file($config{CXX}, "so_acceptfilter.cpp")) {
- $config{HAS_DEFER} = "SO_ACCEPTFILTER";
- print "yes (SO_ACCEPTFILTER)\n";
-} else {
- $config{HAS_DEFER} = "false";
- print "no\n";
-}
-
print "Checking whether epoll is available... ";
$config{HAS_EPOLL} = test_header($config{CXX}, "sys/epoll.h");
print $config{HAS_EPOLL} ? "yes\n" : "no\n";
if ($config{HAS_CLOCK_GETTIME} eq 'true') {
print FILEHANDLE "#define HAS_CLOCK_GETTIME\n";
}
- if ($config{HAS_DEFER} eq "TCP_DEFER_ACCEPT") {
- print FILEHANDLE "#define USE_TCP_DEFER_ACCEPT\n";
- } elsif ($config{HAS_DEFER} eq "SO_ACCEPTFILTER") {
- print FILEHANDLE "#define USE_SO_ACCEPTFILTER\n"
- }
print FILEHANDLE "\n#include \"threadengines/threadengine_pthread.h\"\n";
close(FILEHANDLE);
+++ /dev/null
-/*
- * InspIRCd -- Internet Relay Chat Daemon
- *
- *
- * This file is part of InspIRCd. InspIRCd is free software: you can
- * redistribute it and/or modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation, version 2.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <sys/socket.h>
-
-#ifndef SO_ACCEPTFILTER
- #error
-#endif
-
-int main()
-{
- return 0;
-}
+++ /dev/null
-/*
- * InspIRCd -- Internet Relay Chat Daemon
- *
- *
- * This file is part of InspIRCd. InspIRCd is free software: you can
- * redistribute it and/or modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation, version 2.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <netinet/tcp.h>
-
-#ifndef TCP_DEFER_ACCEPT
- #error
-#endif
-
-int main()
-{
- return 0;
-}
#include "inspircd.h"
#include "socket.h"
#include "socketengine.h"
-
-#ifdef USE_TCP_DEFER_ACCEPT
#include <netinet/tcp.h>
-#endif
ListenSocket::ListenSocket(ConfigTag* tag, const irc::sockets::sockaddrs& bind_to)
: bind_tag(tag)
int timeout = tag->getInt("defer", 0);
if (timeout && !rv)
{
-#ifdef USE_TCP_DEFER_ACCEPT
+#if defined TCP_DEFER_ACCEPT
setsockopt(fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, &timeout, sizeof(timeout));
-#elif defined USE_SO_ACCEPTFILTER
+#elif defined SO_ACCEPTFILTER
struct accept_filter_arg afa;
memset(&afa, 0, sizeof(afa));
strcpy(afa.af_name, "dataready");