summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man4/opentracker.conf.411
-rw-r--r--ot_socket.c3
2 files changed, 13 insertions, 1 deletions
diff --git a/man4/opentracker.conf.4 b/man4/opentracker.conf.4
index b28879f..aa82e1d 100644
--- a/man4/opentracker.conf.4
+++ b/man4/opentracker.conf.4
@@ -100,6 +100,17 @@ group only where the answer is yes.
100.Pa tests/udp_scaling.py 100.Pa tests/udp_scaling.py
101in the source distribution sweeps the setting against a running tracker. 101in the source distribution sweeps the setting against a running tracker.
102Measure on the machine that will carry the traffic. 102Measure on the machine that will carry the traffic.
103.Pp
104On FreeBSD the
105.Xr accf_data 9
106filter has the kernel hold a new connection until data arrives on it, so the
107tracker is woken once with the request already there. opentracker uses it
108wherever it is available; enable it with
109.Cm options ACCEPT_FILTER_DATA
110in the kernel or
111.Va kld_list Ns = Ns Qq accf_data
112in
113.Xr rc.conf 5 .
103.Sh EXAMPLES 114.Sh EXAMPLES
104To specify the address opentracker will listen on for both TCP and UDP connections: 115To specify the address opentracker will listen on for both TCP and UDP connections:
105.Dl listen.tcp_udp 0.0.0.0:6969 116.Dl listen.tcp_udp 0.0.0.0:6969
diff --git a/ot_socket.c b/ot_socket.c
index 78a16d2..48ffc27 100644
--- a/ot_socket.c
+++ b/ot_socket.c
@@ -130,9 +130,10 @@ int socket_defer_accept(int s) {
130 return setsockopt(s, IPPROTO_TCP, TCP_DEFER_ACCEPT, &patience, sizeof(patience)); 130 return setsockopt(s, IPPROTO_TCP, TCP_DEFER_ACCEPT, &patience, sizeof(patience));
131#elif defined(SO_ACCEPTFILTER) 131#elif defined(SO_ACCEPTFILTER)
132 struct accept_filter_arg filter; 132 struct accept_filter_arg filter;
133 const char name[sizeof(filter.af_name)] = "dataready";
133 134
134 memset(&filter, 0, sizeof(filter)); 135 memset(&filter, 0, sizeof(filter));
135 strcpy(filter.af_name, "httpready"); 136 memcpy(filter.af_name, name, sizeof(name));
136 return setsockopt(s, SOL_SOCKET, SO_ACCEPTFILTER, &filter, sizeof(filter)); 137 return setsockopt(s, SOL_SOCKET, SO_ACCEPTFILTER, &filter, sizeof(filter));
137#else 138#else
138 (void)s; 139 (void)s;