Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 1 | /* |
| 2 | * FD polling functions for FreeBSD kqueue() |
| 3 | * |
Willy Tarreau | f817e9f | 2014-01-10 16:58:45 +0100 | [diff] [blame] | 4 | * Copyright 2000-2014 Willy Tarreau <w@1wt.eu> |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +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 | * |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 11 | */ |
| 12 | |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 13 | #include <unistd.h> |
| 14 | #include <sys/time.h> |
| 15 | #include <sys/types.h> |
| 16 | |
| 17 | #include <sys/event.h> |
| 18 | #include <sys/time.h> |
| 19 | |
| 20 | #include <common/compat.h> |
| 21 | #include <common/config.h> |
Willy Tarreau | 0c303ee | 2008-07-07 00:09:58 +0200 | [diff] [blame] | 22 | #include <common/ticks.h> |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 23 | #include <common/time.h> |
Willy Tarreau | 1db3771 | 2007-06-03 17:16:49 +0200 | [diff] [blame] | 24 | #include <common/tools.h> |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 25 | |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 26 | #include <types/global.h> |
| 27 | |
| 28 | #include <proto/fd.h> |
Willy Tarreau | 10146c9 | 2015-04-13 20:44:19 +0200 | [diff] [blame] | 29 | |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 30 | |
| 31 | /* private data */ |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 32 | static int kqueue_fd[MAX_THREADS]; // per-thread kqueue_fd |
Christopher Faulet | d4604ad | 2017-05-29 10:40:41 +0200 | [diff] [blame] | 33 | static THREAD_LOCAL struct kevent *kev = NULL; |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 34 | |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 35 | /* |
Willy Tarreau | 4a22627 | 2012-11-11 20:49:49 +0100 | [diff] [blame] | 36 | * kqueue() poller |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 37 | */ |
Willy Tarreau | 4a22627 | 2012-11-11 20:49:49 +0100 | [diff] [blame] | 38 | REGPRM2 static void _do_poll(struct poller *p, int exp) |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 39 | { |
Willy Tarreau | 4a22627 | 2012-11-11 20:49:49 +0100 | [diff] [blame] | 40 | int status; |
| 41 | int count, fd, delta_ms; |
| 42 | struct timespec timeout; |
| 43 | int updt_idx, en, eo; |
| 44 | int changes = 0; |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 45 | |
Willy Tarreau | 4a22627 | 2012-11-11 20:49:49 +0100 | [diff] [blame] | 46 | /* first, scan the update list to find changes */ |
| 47 | for (updt_idx = 0; updt_idx < fd_nbupdt; updt_idx++) { |
| 48 | fd = fd_updt[updt_idx]; |
Willy Tarreau | f817e9f | 2014-01-10 16:58:45 +0100 | [diff] [blame] | 49 | |
Willy Tarreau | d80cb4e | 2018-01-20 19:30:13 +0100 | [diff] [blame] | 50 | if (!fdtab[fd].owner) { |
| 51 | activity[tid].poll_drop++; |
Willy Tarreau | f817e9f | 2014-01-10 16:58:45 +0100 | [diff] [blame] | 52 | continue; |
Willy Tarreau | d80cb4e | 2018-01-20 19:30:13 +0100 | [diff] [blame] | 53 | } |
Willy Tarreau | f817e9f | 2014-01-10 16:58:45 +0100 | [diff] [blame] | 54 | |
Christopher Faulet | 2a944ee | 2017-11-07 10:42:54 +0100 | [diff] [blame] | 55 | HA_SPIN_LOCK(FD_LOCK, &fdtab[fd].lock); |
Willy Tarreau | ebc78d7 | 2018-01-20 23:53:50 +0100 | [diff] [blame] | 56 | fdtab[fd].update_mask &= ~tid_bit; |
Christopher Faulet | d4604ad | 2017-05-29 10:40:41 +0200 | [diff] [blame] | 57 | fdtab[fd].new = 0; |
| 58 | |
Willy Tarreau | 25002d2 | 2014-01-25 10:32:56 +0100 | [diff] [blame] | 59 | eo = fdtab[fd].state; |
| 60 | en = fd_compute_new_polled_status(eo); |
Christopher Faulet | d4604ad | 2017-05-29 10:40:41 +0200 | [diff] [blame] | 61 | fdtab[fd].state = en; |
Christopher Faulet | 2a944ee | 2017-11-07 10:42:54 +0100 | [diff] [blame] | 62 | HA_SPIN_UNLOCK(FD_LOCK, &fdtab[fd].lock); |
Willy Tarreau | f817e9f | 2014-01-10 16:58:45 +0100 | [diff] [blame] | 63 | |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 64 | if (!(fdtab[fd].thread_mask & tid_bit) || !(en & FD_EV_POLLED_RW)) { |
| 65 | if (!(fdtab[fd].polled_mask & tid_bit)) { |
| 66 | /* fd was not watched, it's still not */ |
| 67 | continue; |
Willy Tarreau | 4a22627 | 2012-11-11 20:49:49 +0100 | [diff] [blame] | 68 | } |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 69 | /* fd totally removed from poll list */ |
| 70 | EV_SET(&kev[changes++], fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); |
| 71 | EV_SET(&kev[changes++], fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); |
| 72 | HA_ATOMIC_AND(&fdtab[fd].polled_mask, ~tid_bit); |
| 73 | } |
| 74 | else { |
| 75 | /* OK fd has to be monitored, it was either added or changed */ |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 76 | |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 77 | if (en & FD_EV_POLLED_R) |
| 78 | EV_SET(&kev[changes++], fd, EVFILT_READ, EV_ADD, 0, 0, NULL); |
| 79 | else if (fdtab[fd].polled_mask & tid_bit) |
| 80 | EV_SET(&kev[changes++], fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); |
| 81 | |
| 82 | if (en & FD_EV_POLLED_W) |
| 83 | EV_SET(&kev[changes++], fd, EVFILT_WRITE, EV_ADD, 0, 0, NULL); |
| 84 | else if (fdtab[fd].polled_mask & tid_bit) |
| 85 | EV_SET(&kev[changes++], fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); |
| 86 | |
| 87 | HA_ATOMIC_OR(&fdtab[fd].polled_mask, tid_bit); |
Willy Tarreau | 4a22627 | 2012-11-11 20:49:49 +0100 | [diff] [blame] | 88 | } |
Willy Tarreau | 4a22627 | 2012-11-11 20:49:49 +0100 | [diff] [blame] | 89 | } |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 90 | if (changes) |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 91 | kevent(kqueue_fd[tid], kev, changes, NULL, 0, NULL); |
Willy Tarreau | 4a22627 | 2012-11-11 20:49:49 +0100 | [diff] [blame] | 92 | fd_nbupdt = 0; |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 93 | |
Willy Tarreau | 0c303ee | 2008-07-07 00:09:58 +0200 | [diff] [blame] | 94 | delta_ms = 0; |
| 95 | timeout.tv_sec = 0; |
| 96 | timeout.tv_nsec = 0; |
Willy Tarreau | 79b8a62 | 2007-05-14 03:15:46 +0200 | [diff] [blame] | 97 | |
Willy Tarreau | 10146c9 | 2015-04-13 20:44:19 +0200 | [diff] [blame] | 98 | if (!exp) { |
| 99 | delta_ms = MAX_DELAY_MS; |
| 100 | timeout.tv_sec = (MAX_DELAY_MS / 1000); |
| 101 | timeout.tv_nsec = (MAX_DELAY_MS % 1000) * 1000000; |
| 102 | } |
| 103 | else if (!tick_is_expired(exp, now_ms)) { |
| 104 | delta_ms = TICKS_TO_MS(tick_remain(now_ms, exp)) + 1; |
| 105 | if (delta_ms > MAX_DELAY_MS) |
| 106 | delta_ms = MAX_DELAY_MS; |
| 107 | timeout.tv_sec = (delta_ms / 1000); |
| 108 | timeout.tv_nsec = (delta_ms % 1000) * 1000000; |
Willy Tarreau | cd5ce2a | 2007-04-09 16:25:46 +0200 | [diff] [blame] | 109 | } |
Willy Tarreau | d80cb4e | 2018-01-20 19:30:13 +0100 | [diff] [blame] | 110 | else |
| 111 | activity[tid].poll_exp++; |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 112 | |
Willy Tarreau | 1db3771 | 2007-06-03 17:16:49 +0200 | [diff] [blame] | 113 | fd = MIN(maxfd, global.tune.maxpollevents); |
Willy Tarreau | 45a1251 | 2011-09-10 16:56:42 +0200 | [diff] [blame] | 114 | gettimeofday(&before_poll, NULL); |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 115 | status = kevent(kqueue_fd[tid], // int kq |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 116 | NULL, // const struct kevent *changelist |
| 117 | 0, // int nchanges |
| 118 | kev, // struct kevent *eventlist |
Willy Tarreau | 1db3771 | 2007-06-03 17:16:49 +0200 | [diff] [blame] | 119 | fd, // int nevents |
Willy Tarreau | b0b37bc | 2008-06-23 14:00:57 +0200 | [diff] [blame] | 120 | &timeout); // const struct timespec *timeout |
| 121 | tv_update_date(delta_ms, status); |
Willy Tarreau | 45a1251 | 2011-09-10 16:56:42 +0200 | [diff] [blame] | 122 | measure_idle(); |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 123 | |
| 124 | for (count = 0; count < status; count++) { |
Christopher Faulet | ab62f51 | 2017-08-30 10:34:36 +0200 | [diff] [blame] | 125 | unsigned int n = 0; |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 126 | fd = kev[count].ident; |
Willy Tarreau | 9845e75 | 2012-07-06 11:44:28 +0200 | [diff] [blame] | 127 | |
Willy Tarreau | d80cb4e | 2018-01-20 19:30:13 +0100 | [diff] [blame] | 128 | if (!fdtab[fd].owner) { |
| 129 | activity[tid].poll_dead++; |
Willy Tarreau | 076be25 | 2012-07-06 16:02:29 +0200 | [diff] [blame] | 130 | continue; |
Willy Tarreau | d80cb4e | 2018-01-20 19:30:13 +0100 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | if (!(fdtab[fd].thread_mask & tid_bit)) { |
| 134 | activity[tid].poll_skip++; |
| 135 | continue; |
| 136 | } |
Willy Tarreau | 076be25 | 2012-07-06 16:02:29 +0200 | [diff] [blame] | 137 | |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 138 | if (kev[count].filter == EVFILT_READ) { |
Willy Tarreau | fa06176 | 2017-03-13 20:49:56 +0100 | [diff] [blame] | 139 | if (kev[count].data) |
Christopher Faulet | ab62f51 | 2017-08-30 10:34:36 +0200 | [diff] [blame] | 140 | n |= FD_POLL_IN; |
Willy Tarreau | 19c4ab9 | 2017-03-13 20:36:48 +0100 | [diff] [blame] | 141 | if (kev[count].flags & EV_EOF) |
Christopher Faulet | ab62f51 | 2017-08-30 10:34:36 +0200 | [diff] [blame] | 142 | n |= FD_POLL_HUP; |
Willy Tarreau | 4a22627 | 2012-11-11 20:49:49 +0100 | [diff] [blame] | 143 | } |
| 144 | else if (kev[count].filter == EVFILT_WRITE) { |
Christopher Faulet | ab62f51 | 2017-08-30 10:34:36 +0200 | [diff] [blame] | 145 | n |= FD_POLL_OUT; |
Willy Tarreau | 19c4ab9 | 2017-03-13 20:36:48 +0100 | [diff] [blame] | 146 | if (kev[count].flags & EV_EOF) |
Christopher Faulet | ab62f51 | 2017-08-30 10:34:36 +0200 | [diff] [blame] | 147 | n |= FD_POLL_ERR; |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 148 | } |
Willy Tarreau | 4a22627 | 2012-11-11 20:49:49 +0100 | [diff] [blame] | 149 | |
Christopher Faulet | ab62f51 | 2017-08-30 10:34:36 +0200 | [diff] [blame] | 150 | fd_update_events(fd, n); |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 151 | } |
| 152 | } |
| 153 | |
Christopher Faulet | d4604ad | 2017-05-29 10:40:41 +0200 | [diff] [blame] | 154 | |
| 155 | static int init_kqueue_per_thread() |
| 156 | { |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 157 | int fd; |
| 158 | |
Christopher Faulet | d4604ad | 2017-05-29 10:40:41 +0200 | [diff] [blame] | 159 | /* we can have up to two events per fd (*/ |
| 160 | kev = calloc(1, sizeof(struct kevent) * 2 * global.maxsock); |
| 161 | if (kev == NULL) |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 162 | goto fail_alloc; |
| 163 | |
| 164 | if (tid) { |
| 165 | kqueue_fd[tid] = kqueue(); |
| 166 | if (kqueue_fd[tid] < 0) |
| 167 | goto fail_fd; |
| 168 | } |
| 169 | |
| 170 | /* we may have to unregister some events initially registered on the |
| 171 | * original fd when it was alone, and/or to register events on the new |
| 172 | * fd for this thread. Let's just mark them as updated, the poller will |
| 173 | * do the rest. |
| 174 | */ |
| 175 | for (fd = 0; fd < maxfd; fd++) |
| 176 | updt_fd_polling(fd); |
| 177 | |
Christopher Faulet | d4604ad | 2017-05-29 10:40:41 +0200 | [diff] [blame] | 178 | return 1; |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 179 | fail_fd: |
| 180 | free(kev); |
| 181 | fail_alloc: |
| 182 | return 0; |
Christopher Faulet | d4604ad | 2017-05-29 10:40:41 +0200 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | static void deinit_kqueue_per_thread() |
| 186 | { |
| 187 | free(kev); |
Christopher Faulet | cd7879a | 2017-10-27 13:53:47 +0200 | [diff] [blame] | 188 | kev = NULL; |
Christopher Faulet | d4604ad | 2017-05-29 10:40:41 +0200 | [diff] [blame] | 189 | } |
| 190 | |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 191 | /* |
| 192 | * Initialization of the kqueue() poller. |
| 193 | * Returns 0 in case of failure, non-zero in case of success. If it fails, it |
| 194 | * disables the poller by setting its pref to 0. |
| 195 | */ |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 196 | REGPRM1 static int _do_init(struct poller *p) |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 197 | { |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 198 | p->private = NULL; |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 199 | |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 200 | kqueue_fd[tid] = kqueue(); |
| 201 | if (kqueue_fd[tid] < 0) |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 202 | goto fail_fd; |
| 203 | |
Christopher Faulet | cd7879a | 2017-10-27 13:53:47 +0200 | [diff] [blame] | 204 | hap_register_per_thread_init(init_kqueue_per_thread); |
| 205 | hap_register_per_thread_deinit(deinit_kqueue_per_thread); |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 206 | return 1; |
| 207 | |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 208 | fail_fd: |
| 209 | p->pref = 0; |
| 210 | return 0; |
| 211 | } |
| 212 | |
| 213 | /* |
| 214 | * Termination of the kqueue() poller. |
| 215 | * Memory is released and the poller is marked as unselectable. |
| 216 | */ |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 217 | REGPRM1 static void _do_term(struct poller *p) |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 218 | { |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 219 | if (kqueue_fd[tid] >= 0) { |
| 220 | close(kqueue_fd[tid]); |
| 221 | kqueue_fd[tid] = -1; |
Willy Tarreau | d79e79b | 2009-05-10 10:18:54 +0200 | [diff] [blame] | 222 | } |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 223 | |
| 224 | p->private = NULL; |
| 225 | p->pref = 0; |
| 226 | } |
| 227 | |
| 228 | /* |
Willy Tarreau | 2ff7622 | 2007-04-09 19:29:56 +0200 | [diff] [blame] | 229 | * Check that the poller works. |
| 230 | * Returns 1 if OK, otherwise 0. |
| 231 | */ |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 232 | REGPRM1 static int _do_test(struct poller *p) |
Willy Tarreau | 2ff7622 | 2007-04-09 19:29:56 +0200 | [diff] [blame] | 233 | { |
| 234 | int fd; |
| 235 | |
| 236 | fd = kqueue(); |
| 237 | if (fd < 0) |
| 238 | return 0; |
| 239 | close(fd); |
| 240 | return 1; |
| 241 | } |
| 242 | |
| 243 | /* |
| 244 | * Recreate the kqueue file descriptor after a fork(). Returns 1 if OK, |
| 245 | * otherwise 0. Note that some pollers need to be reopened after a fork() |
| 246 | * (such as kqueue), and some others may fail to do so in a chroot. |
| 247 | */ |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 248 | REGPRM1 static int _do_fork(struct poller *p) |
Willy Tarreau | 2ff7622 | 2007-04-09 19:29:56 +0200 | [diff] [blame] | 249 | { |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 250 | kqueue_fd[tid] = kqueue(); |
| 251 | if (kqueue_fd[tid] < 0) |
Willy Tarreau | 2ff7622 | 2007-04-09 19:29:56 +0200 | [diff] [blame] | 252 | return 0; |
| 253 | return 1; |
| 254 | } |
| 255 | |
| 256 | /* |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 257 | * It is a constructor, which means that it will automatically be called before |
| 258 | * main(). This is GCC-specific but it works at least since 2.95. |
| 259 | * Special care must be taken so that it does not need any uninitialized data. |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 260 | */ |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 261 | __attribute__((constructor)) |
| 262 | static void _do_register(void) |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 263 | { |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 264 | struct poller *p; |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 265 | int i; |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 266 | |
| 267 | if (nbpollers >= MAX_POLLERS) |
| 268 | return; |
Willy Tarreau | d79e79b | 2009-05-10 10:18:54 +0200 | [diff] [blame] | 269 | |
Willy Tarreau | 7a2364d | 2018-01-19 08:56:14 +0100 | [diff] [blame] | 270 | for (i = 0; i < MAX_THREADS; i++) |
| 271 | kqueue_fd[i] = -1; |
| 272 | |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 273 | p = &pollers[nbpollers++]; |
| 274 | |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 275 | p->name = "kqueue"; |
| 276 | p->pref = 300; |
Willy Tarreau | 19c4ab9 | 2017-03-13 20:36:48 +0100 | [diff] [blame] | 277 | p->flags = HAP_POLL_F_RDHUP; |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 278 | p->private = NULL; |
| 279 | |
Willy Tarreau | 70c6fd8 | 2012-11-11 21:02:34 +0100 | [diff] [blame] | 280 | p->clo = NULL; |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 281 | p->test = _do_test; |
| 282 | p->init = _do_init; |
| 283 | p->term = _do_term; |
| 284 | p->poll = _do_poll; |
| 285 | p->fork = _do_fork; |
Willy Tarreau | 1e63130a | 2007-04-09 12:03:06 +0200 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | |
| 289 | /* |
| 290 | * Local variables: |
| 291 | * c-indent-level: 8 |
| 292 | * c-basic-offset: 8 |
| 293 | * End: |
| 294 | */ |