Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 1 | /* |
Willy Tarreau | 03fa5df | 2010-05-24 21:02:37 +0200 | [diff] [blame] | 2 | * Frontend variables and functions. |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 3 | * |
Willy Tarreau | 03fa5df | 2010-05-24 21:02:37 +0200 | [diff] [blame] | 4 | * Copyright 2000-2010 Willy Tarreau <w@1wt.eu> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 5 | * |
| 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 | |
| 13 | #include <errno.h> |
| 14 | #include <fcntl.h> |
| 15 | #include <stdio.h> |
| 16 | #include <stdlib.h> |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 17 | #include <string.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 18 | |
| 19 | #include <sys/socket.h> |
| 20 | #include <sys/stat.h> |
| 21 | #include <sys/types.h> |
| 22 | |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 23 | #include <common/compat.h> |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 24 | #include <common/config.h> |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 25 | #include <common/time.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 26 | |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 27 | #include <types/global.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 28 | |
Willy Tarreau | 8797c06 | 2007-05-07 00:55:35 +0200 | [diff] [blame] | 29 | #include <proto/acl.h> |
Willy Tarreau | 5446940 | 2006-07-29 16:59:06 +0200 | [diff] [blame] | 30 | #include <proto/buffers.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 31 | #include <proto/fd.h> |
Willy Tarreau | 03fa5df | 2010-05-24 21:02:37 +0200 | [diff] [blame] | 32 | #include <proto/frontend.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 33 | #include <proto/log.h> |
Willy Tarreau | e5f20dc | 2006-12-03 15:21:35 +0100 | [diff] [blame] | 34 | #include <proto/hdr_idx.h> |
Willy Tarreau | 9650f37 | 2009-08-16 14:02:45 +0200 | [diff] [blame] | 35 | #include <proto/proto_tcp.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 36 | #include <proto/proto_http.h> |
Willy Tarreau | 7f062c4 | 2009-03-05 18:43:00 +0100 | [diff] [blame] | 37 | #include <proto/proxy.h> |
Willy Tarreau | c6ca1a0 | 2007-05-13 19:43:47 +0200 | [diff] [blame] | 38 | #include <proto/session.h> |
Willy Tarreau | dded32d | 2008-11-30 19:48:07 +0100 | [diff] [blame] | 39 | #include <proto/stream_interface.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 40 | #include <proto/stream_sock.h> |
| 41 | #include <proto/task.h> |
| 42 | |
| 43 | |
Willy Tarreau | 14c8aac | 2007-05-08 19:46:30 +0200 | [diff] [blame] | 44 | /* Retrieves the original destination address used by the client, and sets the |
| 45 | * SN_FRT_ADDR_SET flag. |
| 46 | */ |
| 47 | void get_frt_addr(struct session *s) |
| 48 | { |
| 49 | socklen_t namelen = sizeof(s->frt_addr); |
| 50 | |
Willy Tarreau | 7e5067d | 2008-12-07 16:27:56 +0100 | [diff] [blame] | 51 | if (get_original_dst(s->si[0].fd, (struct sockaddr_in *)&s->frt_addr, &namelen) == -1) |
| 52 | getsockname(s->si[0].fd, (struct sockaddr *)&s->frt_addr, &namelen); |
Willy Tarreau | 14c8aac | 2007-05-08 19:46:30 +0200 | [diff] [blame] | 53 | s->flags |= SN_FRT_ADDR_SET; |
| 54 | } |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 55 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 56 | /* This function is called from the protocol layer accept() in order to instanciate |
| 57 | * a new proxy. It returns a positive value upon success, 0 if the connection needs |
| 58 | * to be closed and ignored, or a negative value upon critical failure. |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 59 | */ |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 60 | int frontend_accept(struct listener *l, int cfd, struct sockaddr_storage *addr) |
| 61 | { |
| 62 | struct proxy *p = l->frontend; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 63 | struct session *s; |
Willy Tarreau | c2168d3 | 2007-03-03 20:51:44 +0100 | [diff] [blame] | 64 | struct http_txn *txn; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 65 | struct task *t; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 66 | |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 67 | if (unlikely((s = pool_alloc2(pool2_session)) == NULL)) { |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 68 | Alert("out of memory in event_accept().\n"); |
| 69 | goto out_close; |
Willy Tarreau | 7958422 | 2009-03-06 09:18:27 +0100 | [diff] [blame] | 70 | } |
| 71 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 72 | LIST_ADDQ(&sessions, &s->list); |
| 73 | LIST_INIT(&s->back_refs); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 74 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 75 | s->flags = 0; |
| 76 | s->term_trace = 0; |
| 77 | s->cli_addr = *addr; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 78 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 79 | /* if this session comes from a known monitoring system, we want to ignore |
| 80 | * it as soon as possible, which means closing it immediately for TCP. |
| 81 | */ |
Willy Tarreau | de3041d | 2010-05-31 10:56:17 +0200 | [diff] [blame] | 82 | if (unlikely((l->options & LI_O_CHK_MONNET) && |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 83 | addr->ss_family == AF_INET && |
| 84 | (((struct sockaddr_in *)addr)->sin_addr.s_addr & p->mon_mask.s_addr) == p->mon_net.s_addr)) { |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 85 | if (p->mode == PR_MODE_TCP) { |
| 86 | pool_free2(pool2_session, s); |
| 87 | return 0; |
Willy Tarreau | 6e6fb2b | 2009-08-16 18:20:44 +0200 | [diff] [blame] | 88 | } |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 89 | s->flags |= SN_MONITOR; |
| 90 | } |
Willy Tarreau | 6e6fb2b | 2009-08-16 18:20:44 +0200 | [diff] [blame] | 91 | |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 92 | if (unlikely((t = task_new()) == NULL)) { /* disable this proxy for a while */ |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 93 | Alert("out of memory in event_accept().\n"); |
| 94 | goto out_free_session; |
| 95 | } |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 96 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 97 | t->process = l->handler; |
| 98 | t->context = s; |
| 99 | t->nice = l->nice; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 100 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 101 | s->task = t; |
| 102 | s->listener = l; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 103 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 104 | /* Note: initially, the session's backend points to the frontend. |
| 105 | * This changes later when switching rules are executed or |
| 106 | * when the default backend is assigned. |
| 107 | */ |
| 108 | s->be = s->fe = p; |
Alexandre Cassen | 87ea548 | 2007-10-11 20:48:58 +0200 | [diff] [blame] | 109 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 110 | s->req = s->rep = NULL; /* will be allocated later */ |
Willy Tarreau | e803de2 | 2010-01-21 17:43:04 +0100 | [diff] [blame] | 111 | |
Willy Tarreau | f67c978 | 2010-05-23 22:59:00 +0200 | [diff] [blame] | 112 | /* this part should be common with other protocols */ |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 113 | s->si[0].state = s->si[0].prev_state = SI_ST_EST; |
| 114 | s->si[0].err_type = SI_ET_NONE; |
| 115 | s->si[0].err_loc = NULL; |
| 116 | s->si[0].owner = t; |
| 117 | s->si[0].update = stream_sock_data_finish; |
| 118 | s->si[0].shutr = stream_sock_shutr; |
| 119 | s->si[0].shutw = stream_sock_shutw; |
| 120 | s->si[0].chk_rcv = stream_sock_chk_rcv; |
| 121 | s->si[0].chk_snd = stream_sock_chk_snd; |
| 122 | s->si[0].connect = NULL; |
| 123 | s->si[0].iohandler = NULL; |
| 124 | s->si[0].fd = cfd; |
| 125 | s->si[0].flags = SI_FL_NONE | SI_FL_CAP_SPLTCP; /* TCP splicing capable */ |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 126 | if (likely(s->fe->options2 & PR_O2_INDEPSTR)) |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 127 | s->si[0].flags |= SI_FL_INDEP_STR; |
| 128 | s->si[0].exp = TICK_ETERNITY; |
Willy Tarreau | e803de2 | 2010-01-21 17:43:04 +0100 | [diff] [blame] | 129 | |
Willy Tarreau | f67c978 | 2010-05-23 22:59:00 +0200 | [diff] [blame] | 130 | s->logs.accept_date = date; /* user-visible date for logging */ |
| 131 | s->logs.tv_accept = now; /* corrected date for internal use */ |
| 132 | s->uniq_id = totalconn; |
| 133 | proxy_inc_fe_ctr(l, p); /* note: cum_beconn will be increased once assigned */ |
| 134 | |
| 135 | /* now evaluate the tcp-request rules */ |
Willy Tarreau | a5c0ab2 | 2010-05-31 10:30:33 +0200 | [diff] [blame] | 136 | if ((l->options & LI_O_TCP_RULES) && !tcp_exec_req_rules(s)) { |
| 137 | task_free(t); |
| 138 | LIST_DEL(&s->list); |
| 139 | pool_free2(pool2_session, s); |
| 140 | /* let's do a no-linger now to close with a single RST. */ |
| 141 | setsockopt(cfd, SOL_SOCKET, SO_LINGER, (struct linger *) &nolinger, sizeof(struct linger)); |
| 142 | return 0; |
Willy Tarreau | f67c978 | 2010-05-23 22:59:00 +0200 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | /* pre-initialize the other side's stream interface */ |
| 146 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 147 | s->si[1].state = s->si[1].prev_state = SI_ST_INI; |
| 148 | s->si[1].err_type = SI_ET_NONE; |
| 149 | s->si[1].err_loc = NULL; |
| 150 | s->si[1].owner = t; |
| 151 | s->si[1].update = stream_sock_data_finish; |
| 152 | s->si[1].shutr = stream_sock_shutr; |
| 153 | s->si[1].shutw = stream_sock_shutw; |
| 154 | s->si[1].chk_rcv = stream_sock_chk_rcv; |
| 155 | s->si[1].chk_snd = stream_sock_chk_snd; |
| 156 | s->si[1].connect = tcpv4_connect_server; |
| 157 | s->si[1].iohandler = NULL; |
| 158 | s->si[1].exp = TICK_ETERNITY; |
| 159 | s->si[1].fd = -1; /* just to help with debugging */ |
| 160 | s->si[1].flags = SI_FL_NONE; |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 161 | if (likely(s->be->options2 & PR_O2_INDEPSTR)) |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 162 | s->si[1].flags |= SI_FL_INDEP_STR; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 163 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 164 | s->srv = s->prev_srv = s->srv_conn = NULL; |
| 165 | s->pend_pos = NULL; |
| 166 | s->conn_retries = s->be->conn_retries; |
Willy Tarreau | 73de989 | 2006-11-30 11:40:23 +0100 | [diff] [blame] | 167 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 168 | /* init store persistence */ |
| 169 | s->store_count = 0; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 170 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 171 | /* FIXME: the logs are horribly complicated now, because they are |
| 172 | * defined in <p>, <p>, and later <be> and <be>. |
| 173 | */ |
Willy Tarreau | fa7e102 | 2008-10-19 07:30:41 +0200 | [diff] [blame] | 174 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 175 | if (s->flags & SN_MONITOR) |
| 176 | s->logs.logwait = 0; |
| 177 | else |
| 178 | s->logs.logwait = p->to_log; |
Willy Tarreau | fa7e102 | 2008-10-19 07:30:41 +0200 | [diff] [blame] | 179 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 180 | if (s->logs.logwait & LW_REQ) |
| 181 | s->do_log = http_sess_log; |
| 182 | else |
| 183 | s->do_log = tcp_sess_log; |
Willy Tarreau | ddb358d | 2006-12-17 22:55:52 +0100 | [diff] [blame] | 184 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 185 | /* default error reporting function, may be changed by analysers */ |
| 186 | s->srv_error = default_srv_error; |
Emeric Brun | b982a3d | 2010-01-04 15:45:53 +0100 | [diff] [blame] | 187 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 188 | tv_zero(&s->logs.tv_request); |
| 189 | s->logs.t_queue = -1; |
| 190 | s->logs.t_connect = -1; |
| 191 | s->logs.t_data = -1; |
| 192 | s->logs.t_close = 0; |
| 193 | s->logs.bytes_in = s->logs.bytes_out = 0; |
| 194 | s->logs.prx_queue_size = 0; /* we get the number of pending conns before us */ |
| 195 | s->logs.srv_queue_size = 0; /* we will get this number soon */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 196 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 197 | s->data_source = DATA_SRC_NONE; |
Willy Tarreau | a5555ec | 2008-11-30 19:02:32 +0100 | [diff] [blame] | 198 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 199 | txn = &s->txn; |
| 200 | /* Those variables will be checked and freed if non-NULL in |
| 201 | * session.c:session_free(). It is important that they are |
| 202 | * properly initialized. |
| 203 | */ |
| 204 | txn->sessid = NULL; |
| 205 | txn->srv_cookie = NULL; |
| 206 | txn->cli_cookie = NULL; |
| 207 | txn->uri = NULL; |
| 208 | txn->req.cap = NULL; |
| 209 | txn->rsp.cap = NULL; |
| 210 | txn->hdr_idx.v = NULL; |
| 211 | txn->hdr_idx.size = txn->hdr_idx.used = 0; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 212 | |
Willy Tarreau | f67c978 | 2010-05-23 22:59:00 +0200 | [diff] [blame] | 213 | /* Adjust some socket options */ |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 214 | if (unlikely(fcntl(cfd, F_SETFL, O_NONBLOCK) == -1 || |
| 215 | setsockopt(cfd, IPPROTO_TCP, TCP_NODELAY, |
| 216 | (char *) &one, sizeof(one)) == -1)) { |
Willy Tarreau | f67c978 | 2010-05-23 22:59:00 +0200 | [diff] [blame] | 217 | Alert("accept(): cannot set the socket in non blocking mode. Giving up\n"); |
| 218 | goto out_free_task; |
| 219 | } |
| 220 | |
| 221 | if (p->options & PR_O_TCP_CLI_KA) |
| 222 | setsockopt(cfd, SOL_SOCKET, SO_KEEPALIVE, (char *) &one, sizeof(one)); |
| 223 | |
| 224 | if (p->options & PR_O_TCP_NOLING) |
| 225 | setsockopt(cfd, SOL_SOCKET, SO_LINGER, (struct linger *) &nolinger, sizeof(struct linger)); |
| 226 | |
| 227 | if (global.tune.client_sndbuf) |
| 228 | setsockopt(cfd, SOL_SOCKET, SO_SNDBUF, &global.tune.client_sndbuf, sizeof(global.tune.client_sndbuf)); |
| 229 | |
| 230 | if (global.tune.client_rcvbuf) |
| 231 | setsockopt(cfd, SOL_SOCKET, SO_RCVBUF, &global.tune.client_rcvbuf, sizeof(global.tune.client_rcvbuf)); |
| 232 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 233 | if (p->mode == PR_MODE_HTTP) { |
| 234 | /* the captures are only used in HTTP frontends */ |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 235 | if (unlikely(p->nb_req_cap > 0 && |
| 236 | (txn->req.cap = pool_alloc2(p->req_cap_pool)) == NULL)) |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 237 | goto out_fail_reqcap; /* no memory */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 238 | |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 239 | if (unlikely(p->nb_rsp_cap > 0 && |
| 240 | (txn->rsp.cap = pool_alloc2(p->rsp_cap_pool)) == NULL)) |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 241 | goto out_fail_rspcap; /* no memory */ |
| 242 | } |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 243 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 244 | if (p->acl_requires & ACL_USE_L7_ANY) { |
| 245 | /* we have to allocate header indexes only if we know |
| 246 | * that we may make use of them. This of course includes |
| 247 | * (mode == PR_MODE_HTTP). |
Willy Tarreau | 042cc79 | 2007-03-19 16:20:06 +0100 | [diff] [blame] | 248 | */ |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 249 | txn->hdr_idx.size = MAX_HTTP_HDR; |
Willy Tarreau | 45e73e3 | 2006-12-17 00:05:15 +0100 | [diff] [blame] | 250 | |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 251 | if (unlikely((txn->hdr_idx.v = pool_alloc2(p->hdr_idx_pool)) == NULL)) |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 252 | goto out_fail_idx; /* no memory */ |
Willy Tarreau | 45e73e3 | 2006-12-17 00:05:15 +0100 | [diff] [blame] | 253 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 254 | /* and now initialize the HTTP transaction state */ |
| 255 | http_init_txn(s); |
| 256 | } |
Willy Tarreau | e5f20dc | 2006-12-03 15:21:35 +0100 | [diff] [blame] | 257 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 258 | if ((p->mode == PR_MODE_TCP || p->mode == PR_MODE_HTTP) |
| 259 | && (p->logfac1 >= 0 || p->logfac2 >= 0)) { |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 260 | if (likely(p->to_log)) { |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 261 | /* we have the client ip */ |
| 262 | if (s->logs.logwait & LW_CLIP) |
| 263 | if (!(s->logs.logwait &= ~LW_CLIP)) |
| 264 | s->do_log(s); |
Willy Tarreau | a3445fc | 2010-05-20 16:17:07 +0200 | [diff] [blame] | 265 | } |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 266 | else if (s->cli_addr.ss_family == AF_INET) { |
| 267 | char pn[INET_ADDRSTRLEN], sn[INET_ADDRSTRLEN]; |
Willy Tarreau | 14c8aac | 2007-05-08 19:46:30 +0200 | [diff] [blame] | 268 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 269 | if (!(s->flags & SN_FRT_ADDR_SET)) |
| 270 | get_frt_addr(s); |
Willy Tarreau | 14c8aac | 2007-05-08 19:46:30 +0200 | [diff] [blame] | 271 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 272 | if (inet_ntop(AF_INET, (const void *)&((struct sockaddr_in *)&s->frt_addr)->sin_addr, |
| 273 | sn, sizeof(sn)) && |
| 274 | inet_ntop(AF_INET, (const void *)&((struct sockaddr_in *)&s->cli_addr)->sin_addr, |
| 275 | pn, sizeof(pn))) { |
| 276 | send_log(p, LOG_INFO, "Connect from %s:%d to %s:%d (%s/%s)\n", |
| 277 | pn, ntohs(((struct sockaddr_in *)&s->cli_addr)->sin_port), |
| 278 | sn, ntohs(((struct sockaddr_in *)&s->frt_addr)->sin_port), |
| 279 | p->id, (p->mode == PR_MODE_HTTP) ? "HTTP" : "TCP"); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 280 | } |
| 281 | } |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 282 | else { |
| 283 | char pn[INET6_ADDRSTRLEN], sn[INET6_ADDRSTRLEN]; |
Willy Tarreau | 14c8aac | 2007-05-08 19:46:30 +0200 | [diff] [blame] | 284 | |
| 285 | if (!(s->flags & SN_FRT_ADDR_SET)) |
| 286 | get_frt_addr(s); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 287 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 288 | if (inet_ntop(AF_INET6, (const void *)&((struct sockaddr_in6 *)&s->frt_addr)->sin6_addr, |
| 289 | sn, sizeof(sn)) && |
| 290 | inet_ntop(AF_INET6, (const void *)&((struct sockaddr_in6 *)&s->cli_addr)->sin6_addr, |
| 291 | pn, sizeof(pn))) { |
| 292 | send_log(p, LOG_INFO, "Connect from %s:%d to %s:%d (%s/%s)\n", |
| 293 | pn, ntohs(((struct sockaddr_in6 *)&s->cli_addr)->sin6_port), |
| 294 | sn, ntohs(((struct sockaddr_in6 *)&s->frt_addr)->sin6_port), |
| 295 | p->id, (p->mode == PR_MODE_HTTP) ? "HTTP" : "TCP"); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 296 | } |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 297 | } |
| 298 | } |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 299 | |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 300 | if (unlikely((global.mode & MODE_DEBUG) && (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)))) { |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 301 | int len; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 302 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 303 | if (!(s->flags & SN_FRT_ADDR_SET)) |
| 304 | get_frt_addr(s); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 305 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 306 | if (s->cli_addr.ss_family == AF_INET) { |
| 307 | char pn[INET_ADDRSTRLEN]; |
| 308 | inet_ntop(AF_INET, |
| 309 | (const void *)&((struct sockaddr_in *)&s->cli_addr)->sin_addr, |
| 310 | pn, sizeof(pn)); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 311 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 312 | len = sprintf(trash, "%08x:%s.accept(%04x)=%04x from [%s:%d]\n", |
| 313 | s->uniq_id, p->id, (unsigned short)l->fd, (unsigned short)cfd, |
| 314 | pn, ntohs(((struct sockaddr_in *)&s->cli_addr)->sin_port)); |
| 315 | } |
| 316 | else { |
| 317 | char pn[INET6_ADDRSTRLEN]; |
| 318 | inet_ntop(AF_INET6, |
| 319 | (const void *)&((struct sockaddr_in6 *)(&s->cli_addr))->sin6_addr, |
| 320 | pn, sizeof(pn)); |
Willy Tarreau | fa7e102 | 2008-10-19 07:30:41 +0200 | [diff] [blame] | 321 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 322 | len = sprintf(trash, "%08x:%s.accept(%04x)=%04x from [%s:%d]\n", |
| 323 | s->uniq_id, p->id, (unsigned short)l->fd, (unsigned short)cfd, |
| 324 | pn, ntohs(((struct sockaddr_in6 *)(&s->cli_addr))->sin6_port)); |
| 325 | } |
Willy Tarreau | 9a2d154 | 2008-08-30 12:31:07 +0200 | [diff] [blame] | 326 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 327 | write(1, trash, len); |
| 328 | } |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 329 | |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 330 | if (unlikely((s->req = pool_alloc2(pool2_buffer)) == NULL)) |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 331 | goto out_fail_req; /* no memory */ |
Willy Tarreau | 2df28e8 | 2008-08-17 15:20:19 +0200 | [diff] [blame] | 332 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 333 | s->req->size = global.tune.bufsize; |
| 334 | buffer_init(s->req); |
| 335 | s->req->prod = &s->si[0]; |
| 336 | s->req->cons = &s->si[1]; |
| 337 | s->si[0].ib = s->si[1].ob = s->req; |
Willy Tarreau | dc0a6a0 | 2008-08-03 20:38:13 +0200 | [diff] [blame] | 338 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 339 | s->req->flags |= BF_READ_ATTACHED; /* the producer is already connected */ |
Willy Tarreau | d797128 | 2006-07-29 18:36:34 +0200 | [diff] [blame] | 340 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 341 | if (p->mode == PR_MODE_HTTP) |
| 342 | s->req->flags |= BF_READ_DONTWAIT; /* one read is usually enough */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 343 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 344 | /* activate default analysers enabled for this listener */ |
| 345 | s->req->analysers = l->analysers; |
Willy Tarreau | 5446940 | 2006-07-29 16:59:06 +0200 | [diff] [blame] | 346 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 347 | /* note: this should not happen anymore since there's always at least the switching rules */ |
| 348 | if (!s->req->analysers) { |
| 349 | buffer_auto_connect(s->req); /* don't wait to establish connection */ |
| 350 | buffer_auto_close(s->req); /* let the producer forward close requests */ |
| 351 | } |
Willy Tarreau | d797128 | 2006-07-29 18:36:34 +0200 | [diff] [blame] | 352 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 353 | s->req->rto = s->fe->timeout.client; |
Willy Tarreau | d04e858 | 2010-05-31 12:31:35 +0200 | [diff] [blame^] | 354 | s->req->wto = TICK_ETERNITY; |
Willy Tarreau | c65a3ba | 2008-08-11 23:42:50 +0200 | [diff] [blame] | 355 | |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 356 | if (unlikely((s->rep = pool_alloc2(pool2_buffer)) == NULL)) |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 357 | goto out_fail_rep; /* no memory */ |
Willy Tarreau | 5d707e1 | 2009-06-28 11:09:07 +0200 | [diff] [blame] | 358 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 359 | s->rep->size = global.tune.bufsize; |
| 360 | buffer_init(s->rep); |
| 361 | s->rep->prod = &s->si[1]; |
| 362 | s->rep->cons = &s->si[0]; |
| 363 | s->si[0].ob = s->si[1].ib = s->rep; |
| 364 | s->rep->analysers = 0; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 365 | |
Willy Tarreau | d04e858 | 2010-05-31 12:31:35 +0200 | [diff] [blame^] | 366 | s->rep->rto = TICK_ETERNITY; |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 367 | s->rep->wto = s->fe->timeout.client; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 368 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 369 | s->req->rex = TICK_ETERNITY; |
| 370 | s->req->wex = TICK_ETERNITY; |
| 371 | s->req->analyse_exp = TICK_ETERNITY; |
| 372 | s->rep->rex = TICK_ETERNITY; |
| 373 | s->rep->wex = TICK_ETERNITY; |
| 374 | s->rep->analyse_exp = TICK_ETERNITY; |
| 375 | t->expire = TICK_ETERNITY; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 376 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 377 | fd_insert(cfd); |
| 378 | fdtab[cfd].owner = &s->si[0]; |
| 379 | fdtab[cfd].state = FD_STREADY; |
| 380 | fdtab[cfd].flags = FD_FL_TCP | FD_FL_TCP_NODELAY; |
| 381 | if (p->options & PR_O_TCP_NOLING) |
| 382 | fdtab[cfd].flags |= FD_FL_TCP_NOLING; |
Willy Tarreau | 6e6fb2b | 2009-08-16 18:20:44 +0200 | [diff] [blame] | 383 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 384 | fdtab[cfd].cb[DIR_RD].f = l->proto->read; |
| 385 | fdtab[cfd].cb[DIR_RD].b = s->req; |
| 386 | fdtab[cfd].cb[DIR_WR].f = l->proto->write; |
| 387 | fdtab[cfd].cb[DIR_WR].b = s->rep; |
| 388 | fdinfo[cfd].peeraddr = (struct sockaddr *)&s->cli_addr; |
| 389 | fdinfo[cfd].peerlen = sizeof(s->cli_addr); |
Willy Tarreau | a7e7614 | 2007-11-03 14:28:39 +0100 | [diff] [blame] | 390 | |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 391 | if (unlikely((p->mode == PR_MODE_HTTP && (s->flags & SN_MONITOR)) || |
| 392 | (p->mode == PR_MODE_HEALTH && (p->options & PR_O_HTTP_CHK)))) { |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 393 | /* Either we got a request from a monitoring system on an HTTP instance, |
| 394 | * or we're in health check mode with the 'httpchk' option enabled. In |
| 395 | * both cases, we return a fake "HTTP/1.0 200 OK" response and we exit. |
| 396 | */ |
| 397 | struct chunk msg; |
| 398 | chunk_initstr(&msg, "HTTP/1.0 200 OK\r\n\r\n"); |
| 399 | stream_int_retnclose(&s->si[0], &msg); /* forge a 200 response */ |
| 400 | s->req->analysers = 0; |
| 401 | t->expire = s->rep->wex; |
| 402 | } |
Willy Tarreau | 2281b7f | 2010-05-28 19:29:49 +0200 | [diff] [blame] | 403 | else if (unlikely(p->mode == PR_MODE_HEALTH)) { /* health check mode, no client reading */ |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 404 | struct chunk msg; |
| 405 | chunk_initstr(&msg, "OK\n"); |
| 406 | stream_int_retnclose(&s->si[0], &msg); /* forge an "OK" response */ |
| 407 | s->req->analysers = 0; |
| 408 | t->expire = s->rep->wex; |
| 409 | } |
| 410 | else { |
| 411 | EV_FD_SET(cfd, DIR_RD); |
| 412 | } |
Krzysztof Piotr Oledzki | aeebf9b | 2009-10-04 15:43:17 +0200 | [diff] [blame] | 413 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 414 | /* it is important not to call the wakeup function directly but to |
| 415 | * pass through task_wakeup(), because this one knows how to apply |
| 416 | * priorities to tasks. |
| 417 | */ |
| 418 | task_wakeup(t, TASK_WOKEN_INIT); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 419 | |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 420 | return 1; |
Willy Tarreau | 8ced9a4 | 2007-11-04 17:51:50 +0100 | [diff] [blame] | 421 | |
| 422 | /* Error unrolling */ |
| 423 | out_fail_rep: |
Willy Tarreau | 48d63db | 2008-08-03 17:41:33 +0200 | [diff] [blame] | 424 | pool_free2(pool2_buffer, s->req); |
Willy Tarreau | 8ced9a4 | 2007-11-04 17:51:50 +0100 | [diff] [blame] | 425 | out_fail_req: |
Willy Tarreau | 48d63db | 2008-08-03 17:41:33 +0200 | [diff] [blame] | 426 | pool_free2(p->hdr_idx_pool, txn->hdr_idx.v); |
Willy Tarreau | 8ced9a4 | 2007-11-04 17:51:50 +0100 | [diff] [blame] | 427 | out_fail_idx: |
Willy Tarreau | 48d63db | 2008-08-03 17:41:33 +0200 | [diff] [blame] | 428 | pool_free2(p->rsp_cap_pool, txn->rsp.cap); |
Willy Tarreau | 8ced9a4 | 2007-11-04 17:51:50 +0100 | [diff] [blame] | 429 | out_fail_rspcap: |
Willy Tarreau | 48d63db | 2008-08-03 17:41:33 +0200 | [diff] [blame] | 430 | pool_free2(p->req_cap_pool, txn->req.cap); |
Willy Tarreau | 8ced9a4 | 2007-11-04 17:51:50 +0100 | [diff] [blame] | 431 | out_fail_reqcap: |
| 432 | out_free_task: |
Willy Tarreau | a461318 | 2009-03-21 18:13:21 +0100 | [diff] [blame] | 433 | task_free(t); |
Willy Tarreau | 8ced9a4 | 2007-11-04 17:51:50 +0100 | [diff] [blame] | 434 | out_free_session: |
Willy Tarreau | f54f8bd | 2008-11-23 19:53:55 +0100 | [diff] [blame] | 435 | LIST_DEL(&s->list); |
Willy Tarreau | 8ced9a4 | 2007-11-04 17:51:50 +0100 | [diff] [blame] | 436 | pool_free2(pool2_session, s); |
| 437 | out_close: |
Willy Tarreau | eb47268 | 2010-05-28 18:46:57 +0200 | [diff] [blame] | 438 | return -1; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 439 | } |
| 440 | |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 441 | /* set test->i to the id of the frontend */ |
Willy Tarreau | d41f8d8 | 2007-06-10 10:06:18 +0200 | [diff] [blame] | 442 | static int |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 443 | acl_fetch_fe_id(struct proxy *px, struct session *l4, void *l7, int dir, |
| 444 | struct acl_expr *expr, struct acl_test *test) { |
Willy Tarreau | 662b2d8 | 2007-05-08 19:56:15 +0200 | [diff] [blame] | 445 | |
Willy Tarreau | 662b2d8 | 2007-05-08 19:56:15 +0200 | [diff] [blame] | 446 | test->flags = ACL_TEST_F_READ_ONLY; |
Willy Tarreau | 662b2d8 | 2007-05-08 19:56:15 +0200 | [diff] [blame] | 447 | |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 448 | test->i = l4->fe->uuid; |
Willy Tarreau | 662b2d8 | 2007-05-08 19:56:15 +0200 | [diff] [blame] | 449 | |
Emeric Brun | 5d16eda | 2010-01-04 15:47:45 +0100 | [diff] [blame] | 450 | return 1; |
| 451 | } |
| 452 | |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 453 | /* set test->i to the number of connections per second reaching the frontend */ |
Willy Tarreau | d41f8d8 | 2007-06-10 10:06:18 +0200 | [diff] [blame] | 454 | static int |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 455 | acl_fetch_fe_sess_rate(struct proxy *px, struct session *l4, void *l7, int dir, |
| 456 | struct acl_expr *expr, struct acl_test *test) |
Willy Tarreau | 662b2d8 | 2007-05-08 19:56:15 +0200 | [diff] [blame] | 457 | { |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 458 | test->flags = ACL_TEST_F_VOL_TEST; |
| 459 | if (expr->arg_len) { |
| 460 | /* another proxy was designated, we must look for it */ |
| 461 | for (px = proxy; px; px = px->next) |
| 462 | if ((px->cap & PR_CAP_FE) && !strcmp(px->id, expr->arg.str)) |
| 463 | break; |
| 464 | } |
| 465 | if (!px) |
| 466 | return 0; |
Emeric Brun | 5d16eda | 2010-01-04 15:47:45 +0100 | [diff] [blame] | 467 | |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 468 | test->i = read_freq_ctr(&px->fe_sess_per_sec); |
Emeric Brun | 5d16eda | 2010-01-04 15:47:45 +0100 | [diff] [blame] | 469 | return 1; |
| 470 | } |
Alexandre Cassen | 5eb1a90 | 2007-11-29 15:43:32 +0100 | [diff] [blame] | 471 | |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 472 | /* set test->i to the number of concurrent connections on the frontend */ |
Willy Tarreau | d41f8d8 | 2007-06-10 10:06:18 +0200 | [diff] [blame] | 473 | static int |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 474 | acl_fetch_fe_conn(struct proxy *px, struct session *l4, void *l7, int dir, |
| 475 | struct acl_expr *expr, struct acl_test *test) |
Willy Tarreau | 8797c06 | 2007-05-07 00:55:35 +0200 | [diff] [blame] | 476 | { |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 477 | test->flags = ACL_TEST_F_VOL_TEST; |
| 478 | if (expr->arg_len) { |
| 479 | /* another proxy was designated, we must look for it */ |
| 480 | for (px = proxy; px; px = px->next) |
| 481 | if ((px->cap & PR_CAP_FE) && !strcmp(px->id, expr->arg.str)) |
| 482 | break; |
| 483 | } |
| 484 | if (!px) |
| 485 | return 0; |
Krzysztof Piotr Oledzki | 346f76d | 2010-01-12 21:59:30 +0100 | [diff] [blame] | 486 | |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 487 | test->i = px->feconn; |
Krzysztof Piotr Oledzki | 346f76d | 2010-01-12 21:59:30 +0100 | [diff] [blame] | 488 | return 1; |
| 489 | } |
| 490 | |
Willy Tarreau | 8797c06 | 2007-05-07 00:55:35 +0200 | [diff] [blame] | 491 | |
| 492 | /* Note: must not be declared <const> as its list will be overwritten */ |
| 493 | static struct acl_kw_list acl_kws = {{ },{ |
Willy Tarreau | 645513a | 2010-05-24 20:55:15 +0200 | [diff] [blame] | 494 | { "fe_id", acl_parse_int, acl_fetch_fe_id, acl_match_int, ACL_USE_NOTHING }, |
| 495 | { "fe_sess_rate", acl_parse_int, acl_fetch_fe_sess_rate, acl_match_int, ACL_USE_NOTHING }, |
| 496 | { "fe_conn", acl_parse_int, acl_fetch_fe_conn, acl_match_int, ACL_USE_NOTHING }, |
Willy Tarreau | 8797c06 | 2007-05-07 00:55:35 +0200 | [diff] [blame] | 497 | { NULL, NULL, NULL, NULL }, |
| 498 | }}; |
| 499 | |
| 500 | |
| 501 | __attribute__((constructor)) |
Willy Tarreau | 03fa5df | 2010-05-24 21:02:37 +0200 | [diff] [blame] | 502 | static void __frontend_init(void) |
Willy Tarreau | 8797c06 | 2007-05-07 00:55:35 +0200 | [diff] [blame] | 503 | { |
| 504 | acl_register_keywords(&acl_kws); |
| 505 | } |
| 506 | |
| 507 | |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 508 | /* |
| 509 | * Local variables: |
| 510 | * c-indent-level: 8 |
| 511 | * c-basic-offset: 8 |
| 512 | * End: |
| 513 | */ |