blob: 69da2b77ff5a852414cc6fd0b0fdb30cf3167882 [file] [log] [blame]
Willy Tarreaudd815982007-10-16 12:25:14 +02001/*
Willy Tarreaud1d54542012-09-12 22:58:11 +02002 * Listener management functions.
Willy Tarreaudd815982007-10-16 12:25:14 +02003 *
Willy Tarreau0ccb7442013-01-07 22:54:17 +01004 * Copyright 2000-2013 Willy Tarreau <w@1wt.eu>
Willy Tarreaudd815982007-10-16 12:25:14 +02005 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
Willy Tarreau44489252014-01-14 17:52:01 +010013#define _GNU_SOURCE
Willy Tarreau6ae1ba62014-05-07 19:01:58 +020014#include <ctype.h>
Willy Tarreaubbebbbf2012-05-07 21:22:09 +020015#include <errno.h>
Willy Tarreaudd815982007-10-16 12:25:14 +020016#include <stdio.h>
17#include <string.h>
Willy Tarreau95ccdde2014-02-01 09:28:36 +010018#include <unistd.h>
19#include <fcntl.h>
Willy Tarreaudd815982007-10-16 12:25:14 +020020
Willy Tarreau1bc4aab2012-10-08 20:11:03 +020021#include <common/accept4.h>
Willy Tarreaudd815982007-10-16 12:25:14 +020022#include <common/config.h>
Willy Tarreaudabf2e22007-10-28 21:59:24 +010023#include <common/errors.h>
Willy Tarreaudd815982007-10-16 12:25:14 +020024#include <common/mini-clist.h>
25#include <common/standard.h>
Willy Tarreaubbebbbf2012-05-07 21:22:09 +020026#include <common/time.h>
27
28#include <types/global.h>
Willy Tarreaud1d54542012-09-12 22:58:11 +020029#include <types/protocol.h>
Willy Tarreaudd815982007-10-16 12:25:14 +020030
Willy Tarreau645513a2010-05-24 20:55:15 +020031#include <proto/acl.h>
Willy Tarreaub648d632007-10-28 22:13:50 +010032#include <proto/fd.h>
Willy Tarreaubbebbbf2012-05-07 21:22:09 +020033#include <proto/freq_ctr.h>
34#include <proto/log.h>
Willy Tarreau7a798e52016-04-14 11:13:20 +020035#include <proto/listener.h>
Willy Tarreau0ccb7442013-01-07 22:54:17 +010036#include <proto/sample.h>
Willy Tarreaufb0afa72015-04-03 14:46:27 +020037#include <proto/stream.h>
Willy Tarreaubbebbbf2012-05-07 21:22:09 +020038#include <proto/task.h>
Willy Tarreaub648d632007-10-28 22:13:50 +010039
Willy Tarreau26982662012-09-12 23:17:10 +020040/* List head of all known bind keywords */
41static struct bind_kw_list bind_keywords = {
42 .list = LIST_HEAD_INIT(bind_keywords.list)
43};
44
Olivier Houchardf73629d2017-04-05 22:33:04 +020045struct xfer_sock_list *xfer_sock_list = NULL;
46
Willy Tarreaudabf2e22007-10-28 21:59:24 +010047/* This function adds the specified listener's file descriptor to the polling
48 * lists if it is in the LI_LISTEN state. The listener enters LI_READY or
Willy Tarreauae302532014-05-07 19:22:24 +020049 * LI_FULL state depending on its number of connections. In deamon mode, we
50 * also support binding only the relevant processes to their respective
51 * listeners. We don't do that in debug mode however.
Willy Tarreaudabf2e22007-10-28 21:59:24 +010052 */
53void enable_listener(struct listener *listener)
54{
55 if (listener->state == LI_LISTEN) {
William Lallemand095ba4c2017-06-01 17:38:50 +020056 if ((global.mode & (MODE_DAEMON | MODE_MWORKER)) &&
Willy Tarreauae302532014-05-07 19:22:24 +020057 listener->bind_conf->bind_proc &&
58 !(listener->bind_conf->bind_proc & (1UL << (relative_pid - 1)))) {
59 /* we don't want to enable this listener and don't
60 * want any fd event to reach it.
61 */
Olivier Houchard1fc05162017-04-06 01:05:05 +020062 if (!(global.tune.options & GTUNE_SOCKET_TRANSFER))
63 unbind_listener(listener);
64 else {
65 unbind_listener_no_close(listener);
66 listener->state = LI_LISTEN;
67 }
Willy Tarreauae302532014-05-07 19:22:24 +020068 }
69 else if (listener->nbconn < listener->maxconn) {
Willy Tarreau49b046d2012-08-09 12:11:58 +020070 fd_want_recv(listener->fd);
Willy Tarreaudabf2e22007-10-28 21:59:24 +010071 listener->state = LI_READY;
Willy Tarreauae302532014-05-07 19:22:24 +020072 }
73 else {
Willy Tarreaudabf2e22007-10-28 21:59:24 +010074 listener->state = LI_FULL;
75 }
76 }
77}
78
79/* This function removes the specified listener's file descriptor from the
80 * polling lists if it is in the LI_READY or in the LI_FULL state. The listener
81 * enters LI_LISTEN.
82 */
83void disable_listener(struct listener *listener)
84{
85 if (listener->state < LI_READY)
86 return;
87 if (listener->state == LI_READY)
Willy Tarreau49b046d2012-08-09 12:11:58 +020088 fd_stop_recv(listener->fd);
Willy Tarreaue6ca1fc2011-07-24 22:03:52 +020089 if (listener->state == LI_LIMITED)
90 LIST_DEL(&listener->wait_queue);
Willy Tarreaudabf2e22007-10-28 21:59:24 +010091 listener->state = LI_LISTEN;
92}
93
Willy Tarreaube58c382011-07-24 18:28:10 +020094/* This function tries to temporarily disable a listener, depending on the OS
95 * capabilities. Linux unbinds the listen socket after a SHUT_RD, and ignores
96 * SHUT_WR. Solaris refuses either shutdown(). OpenBSD ignores SHUT_RD but
97 * closes upon SHUT_WR and refuses to rebind. So a common validation path
98 * involves SHUT_WR && listen && SHUT_RD. In case of success, the FD's polling
99 * is disabled. It normally returns non-zero, unless an error is reported.
100 */
101int pause_listener(struct listener *l)
102{
Olivier Houchard1fc05162017-04-06 01:05:05 +0200103 if (l->state <= LI_ZOMBIE)
Willy Tarreaube58c382011-07-24 18:28:10 +0200104 return 1;
105
Willy Tarreau092d8652014-07-07 20:22:12 +0200106 if (l->proto->pause) {
107 /* Returns < 0 in case of failure, 0 if the listener
108 * was totally stopped, or > 0 if correctly paused.
109 */
110 int ret = l->proto->pause(l);
Willy Tarreaube58c382011-07-24 18:28:10 +0200111
Willy Tarreau092d8652014-07-07 20:22:12 +0200112 if (ret < 0)
113 return 0;
114 else if (ret == 0)
115 return 1;
Willy Tarreaub3fb60b2012-10-04 08:56:31 +0200116 }
Willy Tarreaube58c382011-07-24 18:28:10 +0200117
Willy Tarreaue6ca1fc2011-07-24 22:03:52 +0200118 if (l->state == LI_LIMITED)
119 LIST_DEL(&l->wait_queue);
120
Willy Tarreau49b046d2012-08-09 12:11:58 +0200121 fd_stop_recv(l->fd);
Willy Tarreaube58c382011-07-24 18:28:10 +0200122 l->state = LI_PAUSED;
123 return 1;
124}
125
Willy Tarreaue6ca1fc2011-07-24 22:03:52 +0200126/* This function tries to resume a temporarily disabled listener. Paused, full,
127 * limited and disabled listeners are handled, which means that this function
128 * may replace enable_listener(). The resulting state will either be LI_READY
129 * or LI_FULL. 0 is returned in case of failure to resume (eg: dead socket).
Willy Tarreauae302532014-05-07 19:22:24 +0200130 * Listeners bound to a different process are not woken up unless we're in
Willy Tarreauaf2fd582015-04-14 12:07:16 +0200131 * foreground mode, and are ignored. If the listener was only in the assigned
132 * state, it's totally rebound. This can happen if a pause() has completely
133 * stopped it. If the resume fails, 0 is returned and an error might be
134 * displayed.
Willy Tarreaube58c382011-07-24 18:28:10 +0200135 */
136int resume_listener(struct listener *l)
137{
William Lallemand095ba4c2017-06-01 17:38:50 +0200138 if ((global.mode & (MODE_DAEMON | MODE_MWORKER)) &&
Willy Tarreau3569df32017-03-15 12:47:46 +0100139 l->bind_conf->bind_proc &&
140 !(l->bind_conf->bind_proc & (1UL << (relative_pid - 1))))
141 return 1;
142
Willy Tarreau1c4b8142014-07-07 21:06:24 +0200143 if (l->state == LI_ASSIGNED) {
144 char msg[100];
145 int err;
146
147 err = l->proto->bind(l, msg, sizeof(msg));
148 if (err & ERR_ALERT)
149 Alert("Resuming listener: %s\n", msg);
150 else if (err & ERR_WARN)
151 Warning("Resuming listener: %s\n", msg);
152
153 if (err & (ERR_FATAL | ERR_ABORT))
154 return 0;
155 }
156
Olivier Houchard1fc05162017-04-06 01:05:05 +0200157 if (l->state < LI_PAUSED || l->state == LI_ZOMBIE)
Willy Tarreaube58c382011-07-24 18:28:10 +0200158 return 0;
159
Willy Tarreaub3fb60b2012-10-04 08:56:31 +0200160 if (l->proto->sock_prot == IPPROTO_TCP &&
161 l->state == LI_PAUSED &&
Willy Tarreaube58c382011-07-24 18:28:10 +0200162 listen(l->fd, l->backlog ? l->backlog : l->maxconn) != 0)
163 return 0;
164
165 if (l->state == LI_READY)
166 return 1;
167
Willy Tarreaue6ca1fc2011-07-24 22:03:52 +0200168 if (l->state == LI_LIMITED)
169 LIST_DEL(&l->wait_queue);
170
Willy Tarreaube58c382011-07-24 18:28:10 +0200171 if (l->nbconn >= l->maxconn) {
172 l->state = LI_FULL;
173 return 1;
174 }
175
Willy Tarreau49b046d2012-08-09 12:11:58 +0200176 fd_want_recv(l->fd);
Willy Tarreaube58c382011-07-24 18:28:10 +0200177 l->state = LI_READY;
178 return 1;
179}
180
Willy Tarreau87b09662015-04-03 00:22:06 +0200181/* Marks a ready listener as full so that the stream code tries to re-enable
Willy Tarreau62793712011-07-24 19:23:38 +0200182 * it upon next close() using resume_listener().
183 */
184void listener_full(struct listener *l)
185{
186 if (l->state >= LI_READY) {
Willy Tarreaue6ca1fc2011-07-24 22:03:52 +0200187 if (l->state == LI_LIMITED)
188 LIST_DEL(&l->wait_queue);
189
Willy Tarreau49b046d2012-08-09 12:11:58 +0200190 fd_stop_recv(l->fd);
Willy Tarreau62793712011-07-24 19:23:38 +0200191 l->state = LI_FULL;
192 }
193}
194
Willy Tarreaue6ca1fc2011-07-24 22:03:52 +0200195/* Marks a ready listener as limited so that we only try to re-enable it when
196 * resources are free again. It will be queued into the specified queue.
197 */
198void limit_listener(struct listener *l, struct list *list)
199{
200 if (l->state == LI_READY) {
201 LIST_ADDQ(list, &l->wait_queue);
Willy Tarreau49b046d2012-08-09 12:11:58 +0200202 fd_stop_recv(l->fd);
Willy Tarreaue6ca1fc2011-07-24 22:03:52 +0200203 l->state = LI_LIMITED;
204 }
205}
206
Willy Tarreaudabf2e22007-10-28 21:59:24 +0100207/* This function adds all of the protocol's listener's file descriptors to the
208 * polling lists when they are in the LI_LISTEN state. It is intended to be
209 * used as a protocol's generic enable_all() primitive, for use after the
210 * fork(). It puts the listeners into LI_READY or LI_FULL states depending on
211 * their number of connections. It always returns ERR_NONE.
212 */
213int enable_all_listeners(struct protocol *proto)
214{
215 struct listener *listener;
216
217 list_for_each_entry(listener, &proto->listeners, proto_list)
218 enable_listener(listener);
219 return ERR_NONE;
220}
221
222/* This function removes all of the protocol's listener's file descriptors from
223 * the polling lists when they are in the LI_READY or LI_FULL states. It is
224 * intended to be used as a protocol's generic disable_all() primitive. It puts
225 * the listeners into LI_LISTEN, and always returns ERR_NONE.
226 */
227int disable_all_listeners(struct protocol *proto)
228{
229 struct listener *listener;
230
231 list_for_each_entry(listener, &proto->listeners, proto_list)
232 disable_listener(listener);
233 return ERR_NONE;
234}
235
Willy Tarreaue6ca1fc2011-07-24 22:03:52 +0200236/* Dequeues all of the listeners waiting for a resource in wait queue <queue>. */
237void dequeue_all_listeners(struct list *list)
238{
239 struct listener *listener, *l_back;
240
241 list_for_each_entry_safe(listener, l_back, list, wait_queue) {
242 /* This cannot fail because the listeners are by definition in
243 * the LI_LIMITED state. The function also removes the entry
244 * from the queue.
245 */
246 resume_listener(listener);
247 }
248}
249
Olivier Houchard1fc05162017-04-06 01:05:05 +0200250static int do_unbind_listener(struct listener *listener, int do_close)
Willy Tarreaub648d632007-10-28 22:13:50 +0100251{
252 if (listener->state == LI_READY)
Willy Tarreau49b046d2012-08-09 12:11:58 +0200253 fd_stop_recv(listener->fd);
Willy Tarreaub648d632007-10-28 22:13:50 +0100254
Willy Tarreaue6ca1fc2011-07-24 22:03:52 +0200255 if (listener->state == LI_LIMITED)
256 LIST_DEL(&listener->wait_queue);
257
Willy Tarreaube58c382011-07-24 18:28:10 +0200258 if (listener->state >= LI_PAUSED) {
Olivier Houchard1fc05162017-04-06 01:05:05 +0200259 if (do_close) {
260 fd_delete(listener->fd);
261 listener->fd = -1;
262 }
263 else
264 fd_remove(listener->fd);
Willy Tarreaub648d632007-10-28 22:13:50 +0100265 listener->state = LI_ASSIGNED;
266 }
267 return ERR_NONE;
268}
269
Olivier Houchard1fc05162017-04-06 01:05:05 +0200270/* This function closes the listening socket for the specified listener,
271 * provided that it's already in a listening state. The listener enters the
272 * LI_ASSIGNED state. It always returns ERR_NONE. This function is intended
273 * to be used as a generic function for standard protocols.
274 */
275int unbind_listener(struct listener *listener)
276{
277 return do_unbind_listener(listener, 1);
278}
279
280/* This function pretends the listener is dead, but keeps the FD opened, so
281 * that we can provide it, for conf reloading.
282 */
283int unbind_listener_no_close(struct listener *listener)
284{
285 return do_unbind_listener(listener, 0);
286}
287
Willy Tarreau3acf8c32007-10-28 22:35:41 +0100288/* This function closes all listening sockets bound to the protocol <proto>,
289 * and the listeners end in LI_ASSIGNED state if they were higher. It does not
290 * detach them from the protocol. It always returns ERR_NONE.
291 */
292int unbind_all_listeners(struct protocol *proto)
293{
294 struct listener *listener;
295
296 list_for_each_entry(listener, &proto->listeners, proto_list)
297 unbind_listener(listener);
298 return ERR_NONE;
299}
300
Willy Tarreau1a64d162007-10-28 22:26:05 +0100301/* Delete a listener from its protocol's list of listeners. The listener's
302 * state is automatically updated from LI_ASSIGNED to LI_INIT. The protocol's
303 * number of listeners is updated. Note that the listener must have previously
304 * been unbound. This is the generic function to use to remove a listener.
305 */
306void delete_listener(struct listener *listener)
307{
308 if (listener->state != LI_ASSIGNED)
309 return;
310 listener->state = LI_INIT;
311 LIST_DEL(&listener->proto_list);
312 listener->proto->nb_listeners--;
313}
314
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200315/* This function is called on a read event from a listening socket, corresponding
316 * to an accept. It tries to accept as many connections as possible, and for each
317 * calls the listener's accept handler (generally the frontend's accept handler).
318 */
Willy Tarreauafad0e02012-08-09 14:45:22 +0200319void listener_accept(int fd)
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200320{
321 struct listener *l = fdtab[fd].owner;
Willy Tarreauc95bad52016-12-22 00:13:31 +0100322 struct proxy *p = l->bind_conf->frontend;
Willy Tarreau50de90a2012-11-23 20:11:45 +0100323 int max_accept = l->maxaccept ? l->maxaccept : 1;
Willy Tarreaubb660302014-05-07 19:47:02 +0200324 int expire;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200325 int cfd;
326 int ret;
Willy Tarreau818dca52014-01-31 19:40:19 +0100327#ifdef USE_ACCEPT4
328 static int accept4_broken;
329#endif
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200330
331 if (unlikely(l->nbconn >= l->maxconn)) {
332 listener_full(l);
Willy Tarreauafad0e02012-08-09 14:45:22 +0200333 return;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200334 }
335
Willy Tarreau93e7c002013-10-07 18:51:07 +0200336 if (!(l->options & LI_O_UNLIMITED) && global.sps_lim) {
337 int max = freq_ctr_remain(&global.sess_per_sec, global.sps_lim, 0);
Willy Tarreau93e7c002013-10-07 18:51:07 +0200338
339 if (unlikely(!max)) {
340 /* frontend accept rate limit was reached */
Willy Tarreau93e7c002013-10-07 18:51:07 +0200341 expire = tick_add(now_ms, next_event_delay(&global.sess_per_sec, global.sps_lim, 0));
Willy Tarreaubb660302014-05-07 19:47:02 +0200342 goto wait_expire;
Willy Tarreau93e7c002013-10-07 18:51:07 +0200343 }
344
345 if (max_accept > max)
346 max_accept = max;
347 }
348
349 if (!(l->options & LI_O_UNLIMITED) && global.cps_lim) {
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200350 int max = freq_ctr_remain(&global.conn_per_sec, global.cps_lim, 0);
351
352 if (unlikely(!max)) {
353 /* frontend accept rate limit was reached */
Willy Tarreau93e7c002013-10-07 18:51:07 +0200354 expire = tick_add(now_ms, next_event_delay(&global.conn_per_sec, global.cps_lim, 0));
Willy Tarreaubb660302014-05-07 19:47:02 +0200355 goto wait_expire;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200356 }
357
358 if (max_accept > max)
359 max_accept = max;
360 }
Willy Tarreaue43d5322013-10-07 20:01:52 +0200361#ifdef USE_OPENSSL
362 if (!(l->options & LI_O_UNLIMITED) && global.ssl_lim && l->bind_conf && l->bind_conf->is_ssl) {
363 int max = freq_ctr_remain(&global.ssl_per_sec, global.ssl_lim, 0);
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200364
Willy Tarreaue43d5322013-10-07 20:01:52 +0200365 if (unlikely(!max)) {
366 /* frontend accept rate limit was reached */
Willy Tarreaue43d5322013-10-07 20:01:52 +0200367 expire = tick_add(now_ms, next_event_delay(&global.ssl_per_sec, global.ssl_lim, 0));
Willy Tarreaubb660302014-05-07 19:47:02 +0200368 goto wait_expire;
Willy Tarreaue43d5322013-10-07 20:01:52 +0200369 }
370
371 if (max_accept > max)
372 max_accept = max;
373 }
374#endif
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200375 if (p && p->fe_sps_lim) {
376 int max = freq_ctr_remain(&p->fe_sess_per_sec, p->fe_sps_lim, 0);
377
378 if (unlikely(!max)) {
379 /* frontend accept rate limit was reached */
380 limit_listener(l, &p->listener_queue);
381 task_schedule(p->task, tick_add(now_ms, next_event_delay(&p->fe_sess_per_sec, p->fe_sps_lim, 0)));
Willy Tarreauafad0e02012-08-09 14:45:22 +0200382 return;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200383 }
384
385 if (max_accept > max)
386 max_accept = max;
387 }
388
389 /* Note: if we fail to allocate a connection because of configured
390 * limits, we'll schedule a new attempt worst 1 second later in the
391 * worst case. If we fail due to system limits or temporary resource
392 * shortage, we try again 100ms later in the worst case.
393 */
394 while (max_accept--) {
395 struct sockaddr_storage addr;
396 socklen_t laddr = sizeof(addr);
397
398 if (unlikely(actconn >= global.maxconn) && !(l->options & LI_O_UNLIMITED)) {
399 limit_listener(l, &global_listener_queue);
400 task_schedule(global_listener_queue_task, tick_add(now_ms, 1000)); /* try again in 1 second */
Willy Tarreauafad0e02012-08-09 14:45:22 +0200401 return;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200402 }
403
404 if (unlikely(p && p->feconn >= p->maxconn)) {
405 limit_listener(l, &p->listener_queue);
Willy Tarreauafad0e02012-08-09 14:45:22 +0200406 return;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200407 }
408
Willy Tarreau1bc4aab2012-10-08 20:11:03 +0200409#ifdef USE_ACCEPT4
Willy Tarreau818dca52014-01-31 19:40:19 +0100410 /* only call accept4() if it's known to be safe, otherwise
411 * fallback to the legacy accept() + fcntl().
412 */
413 if (unlikely(accept4_broken ||
414 ((cfd = accept4(fd, (struct sockaddr *)&addr, &laddr, SOCK_NONBLOCK)) == -1 &&
415 (errno == ENOSYS || errno == EINVAL || errno == EBADF) &&
416 (accept4_broken = 1))))
417#endif
Willy Tarreau6b3b0d42012-10-22 19:32:55 +0200418 if ((cfd = accept(fd, (struct sockaddr *)&addr, &laddr)) != -1)
419 fcntl(cfd, F_SETFL, O_NONBLOCK);
Willy Tarreau818dca52014-01-31 19:40:19 +0100420
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200421 if (unlikely(cfd == -1)) {
422 switch (errno) {
423 case EAGAIN:
Willy Tarreaubb660302014-05-07 19:47:02 +0200424 if (fdtab[fd].ev & FD_POLL_HUP) {
425 /* the listening socket might have been disabled in a shared
426 * process and we're a collateral victim. We'll just pause for
427 * a while in case it comes back. In the mean time, we need to
428 * clear this sticky flag.
429 */
430 fdtab[fd].ev &= ~FD_POLL_HUP;
431 goto transient_error;
432 }
Willy Tarreauf817e9f2014-01-10 16:58:45 +0100433 fd_cant_recv(fd);
Willy Tarreauafad0e02012-08-09 14:45:22 +0200434 return; /* nothing more to accept */
Willy Tarreaubb660302014-05-07 19:47:02 +0200435 case EINVAL:
436 /* might be trying to accept on a shut fd (eg: soft stop) */
437 goto transient_error;
Willy Tarreaua593ec52014-01-20 21:21:30 +0100438 case EINTR:
439 case ECONNABORTED:
440 continue;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200441 case ENFILE:
442 if (p)
443 send_log(p, LOG_EMERG,
444 "Proxy %s reached system FD limit at %d. Please check system tunables.\n",
445 p->id, maxfd);
Willy Tarreaubb660302014-05-07 19:47:02 +0200446 goto transient_error;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200447 case EMFILE:
448 if (p)
449 send_log(p, LOG_EMERG,
450 "Proxy %s reached process FD limit at %d. Please check 'ulimit-n' and restart.\n",
451 p->id, maxfd);
Willy Tarreaubb660302014-05-07 19:47:02 +0200452 goto transient_error;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200453 case ENOBUFS:
454 case ENOMEM:
455 if (p)
456 send_log(p, LOG_EMERG,
457 "Proxy %s reached system memory limit at %d sockets. Please check system tunables.\n",
458 p->id, maxfd);
Willy Tarreaubb660302014-05-07 19:47:02 +0200459 goto transient_error;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200460 default:
Willy Tarreaua593ec52014-01-20 21:21:30 +0100461 /* unexpected result, let's give up and let other tasks run */
Willy Tarreau6c11bd22014-01-24 00:54:27 +0100462 goto stop;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200463 }
464 }
465
466 if (unlikely(cfd >= global.maxsock)) {
467 send_log(p, LOG_EMERG,
468 "Proxy %s reached the configured maximum connection limit. Please check the global 'maxconn' value.\n",
469 p->id);
470 close(cfd);
471 limit_listener(l, &global_listener_queue);
472 task_schedule(global_listener_queue_task, tick_add(now_ms, 1000)); /* try again in 1 second */
Willy Tarreauafad0e02012-08-09 14:45:22 +0200473 return;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200474 }
475
476 /* increase the per-process number of cumulated connections */
477 if (!(l->options & LI_O_UNLIMITED)) {
478 update_freq_ctr(&global.conn_per_sec, 1);
479 if (global.conn_per_sec.curr_ctr > global.cps_max)
480 global.cps_max = global.conn_per_sec.curr_ctr;
481 actconn++;
482 }
483
484 jobs++;
485 totalconn++;
486 l->nbconn++;
487
488 if (l->counters) {
489 if (l->nbconn > l->counters->conn_max)
490 l->counters->conn_max = l->nbconn;
491 }
492
493 ret = l->accept(l, cfd, &addr);
494 if (unlikely(ret <= 0)) {
Willy Tarreau87b09662015-04-03 00:22:06 +0200495 /* The connection was closed by stream_accept(). Either
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200496 * we just have to ignore it (ret == 0) or it's a critical
497 * error due to a resource shortage, and we must stop the
498 * listener (ret < 0).
499 */
500 if (!(l->options & LI_O_UNLIMITED))
501 actconn--;
502 jobs--;
503 l->nbconn--;
504 if (ret == 0) /* successful termination */
505 continue;
506
Willy Tarreaubb660302014-05-07 19:47:02 +0200507 goto transient_error;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200508 }
509
510 if (l->nbconn >= l->maxconn) {
511 listener_full(l);
Willy Tarreauafad0e02012-08-09 14:45:22 +0200512 return;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200513 }
514
Willy Tarreau93e7c002013-10-07 18:51:07 +0200515 /* increase the per-process number of cumulated connections */
516 if (!(l->options & LI_O_UNLIMITED)) {
517 update_freq_ctr(&global.sess_per_sec, 1);
518 if (global.sess_per_sec.curr_ctr > global.sps_max)
519 global.sps_max = global.sess_per_sec.curr_ctr;
520 }
Willy Tarreaue43d5322013-10-07 20:01:52 +0200521#ifdef USE_OPENSSL
522 if (!(l->options & LI_O_UNLIMITED) && l->bind_conf && l->bind_conf->is_ssl) {
523
524 update_freq_ctr(&global.ssl_per_sec, 1);
525 if (global.ssl_per_sec.curr_ctr > global.ssl_max)
526 global.ssl_max = global.ssl_per_sec.curr_ctr;
527 }
528#endif
Willy Tarreau93e7c002013-10-07 18:51:07 +0200529
Willy Tarreauaece46a2012-07-06 12:25:58 +0200530 } /* end of while (max_accept--) */
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200531
Willy Tarreauaece46a2012-07-06 12:25:58 +0200532 /* we've exhausted max_accept, so there is no need to poll again */
Willy Tarreau6c11bd22014-01-24 00:54:27 +0100533 stop:
534 fd_done_recv(fd);
Willy Tarreauafad0e02012-08-09 14:45:22 +0200535 return;
Willy Tarreaubb660302014-05-07 19:47:02 +0200536
537 transient_error:
538 /* pause the listener and try again in 100 ms */
539 expire = tick_add(now_ms, 100);
540
541 wait_expire:
542 limit_listener(l, &global_listener_queue);
543 task_schedule(global_listener_queue_task, tick_first(expire, global_listener_queue_task->expire));
544 return;
Willy Tarreaubbebbbf2012-05-07 21:22:09 +0200545}
546
Willy Tarreau26982662012-09-12 23:17:10 +0200547/*
548 * Registers the bind keyword list <kwl> as a list of valid keywords for next
549 * parsing sessions.
550 */
551void bind_register_keywords(struct bind_kw_list *kwl)
552{
553 LIST_ADDQ(&bind_keywords.list, &kwl->list);
554}
555
556/* Return a pointer to the bind keyword <kw>, or NULL if not found. If the
557 * keyword is found with a NULL ->parse() function, then an attempt is made to
558 * find one with a valid ->parse() function. This way it is possible to declare
559 * platform-dependant, known keywords as NULL, then only declare them as valid
560 * if some options are met. Note that if the requested keyword contains an
561 * opening parenthesis, everything from this point is ignored.
562 */
563struct bind_kw *bind_find_kw(const char *kw)
564{
565 int index;
566 const char *kwend;
567 struct bind_kw_list *kwl;
568 struct bind_kw *ret = NULL;
569
570 kwend = strchr(kw, '(');
571 if (!kwend)
572 kwend = kw + strlen(kw);
573
574 list_for_each_entry(kwl, &bind_keywords.list, list) {
575 for (index = 0; kwl->kw[index].kw != NULL; index++) {
576 if ((strncmp(kwl->kw[index].kw, kw, kwend - kw) == 0) &&
577 kwl->kw[index].kw[kwend-kw] == 0) {
578 if (kwl->kw[index].parse)
579 return &kwl->kw[index]; /* found it !*/
580 else
581 ret = &kwl->kw[index]; /* may be OK */
582 }
583 }
584 }
585 return ret;
586}
587
Willy Tarreau8638f482012-09-18 18:01:17 +0200588/* Dumps all registered "bind" keywords to the <out> string pointer. The
589 * unsupported keywords are only dumped if their supported form was not
590 * found.
591 */
592void bind_dump_kws(char **out)
593{
594 struct bind_kw_list *kwl;
595 int index;
596
597 *out = NULL;
598 list_for_each_entry(kwl, &bind_keywords.list, list) {
599 for (index = 0; kwl->kw[index].kw != NULL; index++) {
600 if (kwl->kw[index].parse ||
601 bind_find_kw(kwl->kw[index].kw) == &kwl->kw[index]) {
Willy Tarreau51fb7652012-09-18 18:24:39 +0200602 memprintf(out, "%s[%4s] %s%s%s\n", *out ? *out : "",
603 kwl->scope,
Willy Tarreau8638f482012-09-18 18:01:17 +0200604 kwl->kw[index].kw,
Willy Tarreau51fb7652012-09-18 18:24:39 +0200605 kwl->kw[index].skip ? " <arg>" : "",
606 kwl->kw[index].parse ? "" : " (not supported)");
Willy Tarreau8638f482012-09-18 18:01:17 +0200607 }
608 }
609 }
610}
611
Willy Tarreau645513a2010-05-24 20:55:15 +0200612/************************************************************************/
Willy Tarreau0ccb7442013-01-07 22:54:17 +0100613/* All supported sample and ACL keywords must be declared here. */
Willy Tarreau645513a2010-05-24 20:55:15 +0200614/************************************************************************/
615
Willy Tarreaua5e37562011-12-16 17:06:15 +0100616/* set temp integer to the number of connexions to the same listening socket */
Willy Tarreau645513a2010-05-24 20:55:15 +0200617static int
Thierry FOURNIER0786d052015-05-11 15:42:45 +0200618smp_fetch_dconn(const struct arg *args, struct sample *smp, const char *kw, void *private)
Willy Tarreau645513a2010-05-24 20:55:15 +0200619{
Thierry FOURNIER8c542ca2015-08-19 09:00:18 +0200620 smp->data.type = SMP_T_SINT;
Thierry FOURNIER136f9d32015-08-19 09:07:19 +0200621 smp->data.u.sint = smp->sess->listener->nbconn;
Willy Tarreau645513a2010-05-24 20:55:15 +0200622 return 1;
623}
624
Willy Tarreaua5e37562011-12-16 17:06:15 +0100625/* set temp integer to the id of the socket (listener) */
Willy Tarreau645513a2010-05-24 20:55:15 +0200626static int
Thierry FOURNIER0786d052015-05-11 15:42:45 +0200627smp_fetch_so_id(const struct arg *args, struct sample *smp, const char *kw, void *private)
Willy Tarreau37406352012-04-23 16:16:37 +0200628{
Thierry FOURNIER8c542ca2015-08-19 09:00:18 +0200629 smp->data.type = SMP_T_SINT;
Thierry FOURNIER136f9d32015-08-19 09:07:19 +0200630 smp->data.u.sint = smp->sess->listener->luid;
Willy Tarreau645513a2010-05-24 20:55:15 +0200631 return 1;
632}
633
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200634/* parse the "accept-proxy" bind keyword */
Willy Tarreau4348fad2012-09-20 16:48:07 +0200635static int bind_parse_accept_proxy(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200636{
637 struct listener *l;
638
Willy Tarreau4348fad2012-09-20 16:48:07 +0200639 list_for_each_entry(l, &conf->listeners, by_bind)
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200640 l->options |= LI_O_ACC_PROXY;
641
642 return 0;
643}
644
Bertrand Jacquin93b227d2016-06-04 15:11:10 +0100645/* parse the "accept-netscaler-cip" bind keyword */
646static int bind_parse_accept_netscaler_cip(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
647{
648 struct listener *l;
649 uint32_t val;
650
651 if (!*args[cur_arg + 1]) {
652 memprintf(err, "'%s' : missing value", args[cur_arg]);
653 return ERR_ALERT | ERR_FATAL;
654 }
655
656 val = atol(args[cur_arg + 1]);
657 if (val <= 0) {
658 memprintf(err, "'%s' : invalid value %d, must be > 0", args[cur_arg], val);
659 return ERR_ALERT | ERR_FATAL;
660 }
661
662 list_for_each_entry(l, &conf->listeners, by_bind) {
663 l->options |= LI_O_ACC_CIP;
664 conf->ns_cip_magic = val;
665 }
666
667 return 0;
668}
669
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200670/* parse the "backlog" bind keyword */
Willy Tarreau4348fad2012-09-20 16:48:07 +0200671static int bind_parse_backlog(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200672{
673 struct listener *l;
674 int val;
675
676 if (!*args[cur_arg + 1]) {
Willy Tarreaueb6cead2012-09-20 19:43:14 +0200677 memprintf(err, "'%s' : missing value", args[cur_arg]);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200678 return ERR_ALERT | ERR_FATAL;
679 }
680
681 val = atol(args[cur_arg + 1]);
682 if (val <= 0) {
Willy Tarreaueb6cead2012-09-20 19:43:14 +0200683 memprintf(err, "'%s' : invalid value %d, must be > 0", args[cur_arg], val);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200684 return ERR_ALERT | ERR_FATAL;
685 }
686
Willy Tarreau4348fad2012-09-20 16:48:07 +0200687 list_for_each_entry(l, &conf->listeners, by_bind)
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200688 l->backlog = val;
689
690 return 0;
691}
692
693/* parse the "id" bind keyword */
Willy Tarreau4348fad2012-09-20 16:48:07 +0200694static int bind_parse_id(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200695{
696 struct eb32_node *node;
Willy Tarreau4348fad2012-09-20 16:48:07 +0200697 struct listener *l, *new;
Thierry Fourniere7fe8eb2016-02-26 08:45:58 +0100698 char *error;
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200699
Willy Tarreau4348fad2012-09-20 16:48:07 +0200700 if (conf->listeners.n != conf->listeners.p) {
Willy Tarreaueb6cead2012-09-20 19:43:14 +0200701 memprintf(err, "'%s' can only be used with a single socket", args[cur_arg]);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200702 return ERR_ALERT | ERR_FATAL;
703 }
704
705 if (!*args[cur_arg + 1]) {
Willy Tarreaueb6cead2012-09-20 19:43:14 +0200706 memprintf(err, "'%s' : expects an integer argument", args[cur_arg]);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200707 return ERR_ALERT | ERR_FATAL;
708 }
709
Willy Tarreau4348fad2012-09-20 16:48:07 +0200710 new = LIST_NEXT(&conf->listeners, struct listener *, by_bind);
Thierry Fourniere7fe8eb2016-02-26 08:45:58 +0100711 new->luid = strtol(args[cur_arg + 1], &error, 10);
712 if (*error != '\0') {
713 memprintf(err, "'%s' : expects an integer argument, found '%s'", args[cur_arg], args[cur_arg + 1]);
714 return ERR_ALERT | ERR_FATAL;
715 }
Willy Tarreau4348fad2012-09-20 16:48:07 +0200716 new->conf.id.key = new->luid;
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200717
Willy Tarreau4348fad2012-09-20 16:48:07 +0200718 if (new->luid <= 0) {
Willy Tarreaueb6cead2012-09-20 19:43:14 +0200719 memprintf(err, "'%s' : custom id has to be > 0", args[cur_arg]);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200720 return ERR_ALERT | ERR_FATAL;
721 }
722
Willy Tarreau4348fad2012-09-20 16:48:07 +0200723 node = eb32_lookup(&px->conf.used_listener_id, new->luid);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200724 if (node) {
725 l = container_of(node, struct listener, conf.id);
Willy Tarreaueb6cead2012-09-20 19:43:14 +0200726 memprintf(err, "'%s' : custom id %d already used at %s:%d ('bind %s')",
727 args[cur_arg], l->luid, l->bind_conf->file, l->bind_conf->line,
728 l->bind_conf->arg);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200729 return ERR_ALERT | ERR_FATAL;
730 }
731
Willy Tarreau4348fad2012-09-20 16:48:07 +0200732 eb32_insert(&px->conf.used_listener_id, &new->conf.id);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200733 return 0;
734}
735
736/* parse the "maxconn" bind keyword */
Willy Tarreau4348fad2012-09-20 16:48:07 +0200737static int bind_parse_maxconn(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200738{
739 struct listener *l;
740 int val;
741
742 if (!*args[cur_arg + 1]) {
Willy Tarreaueb6cead2012-09-20 19:43:14 +0200743 memprintf(err, "'%s' : missing value", args[cur_arg]);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200744 return ERR_ALERT | ERR_FATAL;
745 }
746
747 val = atol(args[cur_arg + 1]);
748 if (val <= 0) {
Willy Tarreaueb6cead2012-09-20 19:43:14 +0200749 memprintf(err, "'%s' : invalid value %d, must be > 0", args[cur_arg], val);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200750 return ERR_ALERT | ERR_FATAL;
751 }
752
Willy Tarreau4348fad2012-09-20 16:48:07 +0200753 list_for_each_entry(l, &conf->listeners, by_bind)
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200754 l->maxconn = val;
755
756 return 0;
757}
758
759/* parse the "name" bind keyword */
Willy Tarreau4348fad2012-09-20 16:48:07 +0200760static int bind_parse_name(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200761{
762 struct listener *l;
763
764 if (!*args[cur_arg + 1]) {
Willy Tarreaueb6cead2012-09-20 19:43:14 +0200765 memprintf(err, "'%s' : missing name", args[cur_arg]);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200766 return ERR_ALERT | ERR_FATAL;
767 }
768
Willy Tarreau4348fad2012-09-20 16:48:07 +0200769 list_for_each_entry(l, &conf->listeners, by_bind)
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200770 l->name = strdup(args[cur_arg + 1]);
771
772 return 0;
773}
774
775/* parse the "nice" bind keyword */
Willy Tarreau4348fad2012-09-20 16:48:07 +0200776static int bind_parse_nice(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200777{
778 struct listener *l;
779 int val;
780
781 if (!*args[cur_arg + 1]) {
Willy Tarreaueb6cead2012-09-20 19:43:14 +0200782 memprintf(err, "'%s' : missing value", args[cur_arg]);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200783 return ERR_ALERT | ERR_FATAL;
784 }
785
786 val = atol(args[cur_arg + 1]);
787 if (val < -1024 || val > 1024) {
Willy Tarreaueb6cead2012-09-20 19:43:14 +0200788 memprintf(err, "'%s' : invalid value %d, allowed range is -1024..1024", args[cur_arg], val);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200789 return ERR_ALERT | ERR_FATAL;
790 }
791
Willy Tarreau4348fad2012-09-20 16:48:07 +0200792 list_for_each_entry(l, &conf->listeners, by_bind)
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200793 l->nice = val;
794
795 return 0;
796}
797
Willy Tarreau6ae1ba62014-05-07 19:01:58 +0200798/* parse the "process" bind keyword */
799static int bind_parse_process(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
800{
801 unsigned long set = 0;
802 unsigned int low, high;
803
804 if (strcmp(args[cur_arg + 1], "all") == 0) {
805 set = 0;
806 }
807 else if (strcmp(args[cur_arg + 1], "odd") == 0) {
808 set |= ~0UL/3UL; /* 0x555....555 */
809 }
810 else if (strcmp(args[cur_arg + 1], "even") == 0) {
811 set |= (~0UL/3UL) << 1; /* 0xAAA...AAA */
812 }
813 else if (isdigit((int)*args[cur_arg + 1])) {
814 char *dash = strchr(args[cur_arg + 1], '-');
815
816 low = high = str2uic(args[cur_arg + 1]);
817 if (dash)
818 high = str2uic(dash + 1);
819
820 if (high < low) {
821 unsigned int swap = low;
822 low = high;
823 high = swap;
824 }
825
826 if (low < 1 || high > LONGBITS) {
827 memprintf(err, "'%s' : invalid range %d-%d, allowed range is 1..%d", args[cur_arg], low, high, LONGBITS);
828 return ERR_ALERT | ERR_FATAL;
829 }
830 while (low <= high)
831 set |= 1UL << (low++ - 1);
832 }
833 else {
834 memprintf(err, "'%s' expects 'all', 'odd', 'even', or a process range with numbers from 1 to %d.", args[cur_arg], LONGBITS);
835 return ERR_ALERT | ERR_FATAL;
836 }
837
838 conf->bind_proc = set;
839 return 0;
840}
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200841
Willy Tarreau61612d42012-04-19 18:42:05 +0200842/* Note: must not be declared <const> as its list will be overwritten.
843 * Please take care of keeping this list alphabetically sorted.
844 */
Willy Tarreaudc13c112013-06-21 23:16:39 +0200845static struct sample_fetch_kw_list smp_kws = {ILH, {
Thierry FOURNIER07ee64e2015-07-06 23:43:03 +0200846 { "dst_conn", smp_fetch_dconn, 0, NULL, SMP_T_SINT, SMP_USE_FTEND, },
847 { "so_id", smp_fetch_so_id, 0, NULL, SMP_T_SINT, SMP_USE_FTEND, },
Willy Tarreau0ccb7442013-01-07 22:54:17 +0100848 { /* END */ },
849}};
850
851/* Note: must not be declared <const> as its list will be overwritten.
852 * Please take care of keeping this list alphabetically sorted.
853 */
Willy Tarreaudc13c112013-06-21 23:16:39 +0200854static struct acl_kw_list acl_kws = {ILH, {
Willy Tarreau0ccb7442013-01-07 22:54:17 +0100855 { /* END */ },
Willy Tarreau645513a2010-05-24 20:55:15 +0200856}};
857
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200858/* Note: must not be declared <const> as its list will be overwritten.
859 * Please take care of keeping this list alphabetically sorted, doing so helps
860 * all code contributors.
861 * Optional keywords are also declared with a NULL ->parse() function so that
862 * the config parser can report an appropriate error when a known keyword was
863 * not enabled.
864 */
Willy Tarreau51fb7652012-09-18 18:24:39 +0200865static struct bind_kw_list bind_kws = { "ALL", { }, {
Bertrand Jacquin93b227d2016-06-04 15:11:10 +0100866 { "accept-netscaler-cip", bind_parse_accept_netscaler_cip, 1 }, /* enable NetScaler Client IP insertion protocol */
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200867 { "accept-proxy", bind_parse_accept_proxy, 0 }, /* enable PROXY protocol */
868 { "backlog", bind_parse_backlog, 1 }, /* set backlog of listening socket */
869 { "id", bind_parse_id, 1 }, /* set id of listening socket */
870 { "maxconn", bind_parse_maxconn, 1 }, /* set maxconn of listening socket */
871 { "name", bind_parse_name, 1 }, /* set name of listening socket */
872 { "nice", bind_parse_nice, 1 }, /* set nice of listening socket */
Willy Tarreau6ae1ba62014-05-07 19:01:58 +0200873 { "process", bind_parse_process, 1 }, /* set list of allowed process for this socket */
Willy Tarreau0ccb7442013-01-07 22:54:17 +0100874 { /* END */ },
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200875}};
876
Willy Tarreau645513a2010-05-24 20:55:15 +0200877__attribute__((constructor))
Willy Tarreaud1d54542012-09-12 22:58:11 +0200878static void __listener_init(void)
Willy Tarreau645513a2010-05-24 20:55:15 +0200879{
Willy Tarreau0ccb7442013-01-07 22:54:17 +0100880 sample_register_fetches(&smp_kws);
Willy Tarreau645513a2010-05-24 20:55:15 +0200881 acl_register_keywords(&acl_kws);
Willy Tarreau3dcc3412012-09-18 17:17:28 +0200882 bind_register_keywords(&bind_kws);
Willy Tarreau645513a2010-05-24 20:55:15 +0200883}
884
885/*
886 * Local variables:
887 * c-indent-level: 8
888 * c-basic-offset: 8
889 * End:
890 */