Willy Tarreau | cff6411 | 2008-11-03 06:26:53 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Functions managing stream_interface structures |
| 3 | * |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 4 | * Copyright 2000-2009 Willy Tarreau <w@1wt.eu> |
Willy Tarreau | cff6411 | 2008-11-03 06:26:53 +0100 | [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> |
| 17 | |
| 18 | #include <sys/socket.h> |
| 19 | #include <sys/stat.h> |
| 20 | #include <sys/types.h> |
| 21 | |
| 22 | #include <common/compat.h> |
| 23 | #include <common/config.h> |
| 24 | #include <common/debug.h> |
| 25 | #include <common/standard.h> |
| 26 | #include <common/ticks.h> |
| 27 | #include <common/time.h> |
| 28 | |
| 29 | #include <proto/buffers.h> |
Willy Tarreau | cff6411 | 2008-11-03 06:26:53 +0100 | [diff] [blame] | 30 | #include <proto/fd.h> |
Willy Tarreau | 269358d | 2009-09-20 20:14:49 +0200 | [diff] [blame] | 31 | #include <proto/stream_interface.h> |
Willy Tarreau | cff6411 | 2008-11-03 06:26:53 +0100 | [diff] [blame] | 32 | #include <proto/stream_sock.h> |
| 33 | #include <proto/task.h> |
| 34 | |
| 35 | /* |
| 36 | * This function only has to be called once after a wakeup event in case of |
| 37 | * suspected timeout. It controls the stream interface timeouts and sets |
| 38 | * si->flags accordingly. It does NOT close anything, as this timeout may |
| 39 | * be used for any purpose. It returns 1 if the timeout fired, otherwise |
| 40 | * zero. |
| 41 | */ |
| 42 | int stream_int_check_timeouts(struct stream_interface *si) |
| 43 | { |
| 44 | if (tick_is_expired(si->exp, now_ms)) { |
| 45 | si->flags |= SI_FL_EXP; |
| 46 | return 1; |
| 47 | } |
| 48 | return 0; |
| 49 | } |
| 50 | |
Willy Tarreau | fe3718a | 2008-11-30 18:14:12 +0100 | [diff] [blame] | 51 | /* to be called only when in SI_ST_DIS with SI_FL_ERR */ |
Willy Tarreau | cff6411 | 2008-11-03 06:26:53 +0100 | [diff] [blame] | 52 | void stream_int_report_error(struct stream_interface *si) |
| 53 | { |
| 54 | if (!si->err_type) |
| 55 | si->err_type = SI_ET_DATA_ERR; |
| 56 | |
Willy Tarreau | cff6411 | 2008-11-03 06:26:53 +0100 | [diff] [blame] | 57 | si->ob->flags |= BF_WRITE_ERROR; |
Willy Tarreau | cff6411 | 2008-11-03 06:26:53 +0100 | [diff] [blame] | 58 | si->ib->flags |= BF_READ_ERROR; |
| 59 | } |
| 60 | |
| 61 | /* |
Willy Tarreau | dded32d | 2008-11-30 19:48:07 +0100 | [diff] [blame] | 62 | * Returns a message to the client ; the connection is shut down for read, |
| 63 | * and the request is cleared so that no server connection can be initiated. |
| 64 | * The buffer is marked for read shutdown on the other side to protect the |
| 65 | * message, and the buffer write is enabled. The message is contained in a |
Willy Tarreau | 148d099 | 2010-01-10 10:21:21 +0100 | [diff] [blame] | 66 | * "chunk". If it is null, then an empty message is used. The reply buffer does |
| 67 | * not need to be empty before this, and its contents will not be overwritten. |
| 68 | * The primary goal of this function is to return error messages to a client. |
Willy Tarreau | dded32d | 2008-11-30 19:48:07 +0100 | [diff] [blame] | 69 | */ |
| 70 | void stream_int_retnclose(struct stream_interface *si, const struct chunk *msg) |
| 71 | { |
Willy Tarreau | 148d099 | 2010-01-10 10:21:21 +0100 | [diff] [blame] | 72 | buffer_auto_read(si->ib); |
Willy Tarreau | dded32d | 2008-11-30 19:48:07 +0100 | [diff] [blame] | 73 | buffer_abort(si->ib); |
Willy Tarreau | 148d099 | 2010-01-10 10:21:21 +0100 | [diff] [blame] | 74 | buffer_auto_close(si->ib); |
| 75 | buffer_erase(si->ib); |
| 76 | if (likely(msg && msg->len)) |
Willy Tarreau | dded32d | 2008-11-30 19:48:07 +0100 | [diff] [blame] | 77 | buffer_write(si->ob, msg->str, msg->len); |
| 78 | |
| 79 | si->ob->wex = tick_add_ifset(now_ms, si->ob->wto); |
Willy Tarreau | 148d099 | 2010-01-10 10:21:21 +0100 | [diff] [blame] | 80 | buffer_auto_read(si->ob); |
Willy Tarreau | 520d95e | 2009-09-19 21:04:57 +0200 | [diff] [blame] | 81 | buffer_auto_close(si->ob); |
Willy Tarreau | 5d881d0 | 2009-12-27 22:51:06 +0100 | [diff] [blame] | 82 | buffer_shutr_now(si->ob); |
Willy Tarreau | 5d881d0 | 2009-12-27 22:51:06 +0100 | [diff] [blame] | 83 | } |
| 84 | |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 85 | /* default update function for scheduled tasks, not used for embedded tasks */ |
| 86 | void stream_int_update(struct stream_interface *si) |
| 87 | { |
| 88 | DPRINTF(stderr, "%s: si=%p, si->state=%d ib->flags=%08x ob->flags=%08x\n", |
| 89 | __FUNCTION__, |
| 90 | si, si->state, si->ib->flags, si->ob->flags); |
| 91 | |
| 92 | if (!(si->flags & SI_FL_DONT_WAKE) && si->owner) |
| 93 | task_wakeup(si->owner, TASK_WOKEN_IO); |
| 94 | } |
| 95 | |
| 96 | /* default update function for embedded tasks, to be used at the end of the i/o handler */ |
| 97 | void stream_int_update_embedded(struct stream_interface *si) |
| 98 | { |
Willy Tarreau | 3488e25 | 2010-08-09 16:24:56 +0200 | [diff] [blame] | 99 | int old_flags = si->flags; |
| 100 | |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 101 | DPRINTF(stderr, "%s: si=%p, si->state=%d ib->flags=%08x ob->flags=%08x\n", |
| 102 | __FUNCTION__, |
| 103 | si, si->state, si->ib->flags, si->ob->flags); |
| 104 | |
| 105 | if (si->state != SI_ST_EST) |
| 106 | return; |
| 107 | |
| 108 | if ((si->ob->flags & (BF_OUT_EMPTY|BF_SHUTW|BF_HIJACK|BF_SHUTW_NOW)) == (BF_OUT_EMPTY|BF_SHUTW_NOW)) |
| 109 | si->shutw(si); |
| 110 | |
| 111 | if ((si->ob->flags & (BF_FULL|BF_SHUTW|BF_SHUTW_NOW|BF_HIJACK)) == 0) |
| 112 | si->flags |= SI_FL_WAIT_DATA; |
| 113 | |
Willy Tarreau | 96fd4b5 | 2009-10-04 17:18:35 +0200 | [diff] [blame] | 114 | /* we're almost sure that we need some space if the buffer is not |
| 115 | * empty, even if it's not full, because the applets can't fill it. |
| 116 | */ |
Willy Tarreau | f1ba4b3 | 2009-10-17 14:37:52 +0200 | [diff] [blame] | 117 | if ((si->ib->flags & (BF_SHUTR|BF_OUT_EMPTY|BF_DONT_READ)) == 0) |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 118 | si->flags |= SI_FL_WAIT_ROOM; |
| 119 | |
Willy Tarreau | f27b5ea | 2009-10-03 22:01:18 +0200 | [diff] [blame] | 120 | if (si->ob->flags & BF_WRITE_ACTIVITY) { |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 121 | if (tick_isset(si->ob->wex)) |
| 122 | si->ob->wex = tick_add_ifset(now_ms, si->ob->wto); |
| 123 | } |
| 124 | |
Willy Tarreau | f27b5ea | 2009-10-03 22:01:18 +0200 | [diff] [blame] | 125 | if (si->ib->flags & BF_READ_ACTIVITY || |
| 126 | (si->ob->flags & BF_WRITE_ACTIVITY && !(si->flags & SI_FL_INDEP_STR))) { |
| 127 | if (tick_isset(si->ib->rex)) |
| 128 | si->ib->rex = tick_add_ifset(now_ms, si->ib->rto); |
| 129 | } |
| 130 | |
Willy Tarreau | 3488e25 | 2010-08-09 16:24:56 +0200 | [diff] [blame] | 131 | /* save flags to detect changes */ |
| 132 | old_flags = si->flags; |
Willy Tarreau | f1ba4b3 | 2009-10-17 14:37:52 +0200 | [diff] [blame] | 133 | if (likely((si->ob->flags & (BF_SHUTW|BF_WRITE_PARTIAL|BF_FULL|BF_DONT_READ)) == BF_WRITE_PARTIAL && |
Willy Tarreau | 96fd4b5 | 2009-10-04 17:18:35 +0200 | [diff] [blame] | 134 | (si->ob->prod->flags & SI_FL_WAIT_ROOM))) |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 135 | si->ob->prod->chk_rcv(si->ob->prod); |
| 136 | |
Willy Tarreau | 96fd4b5 | 2009-10-04 17:18:35 +0200 | [diff] [blame] | 137 | if (((si->ib->flags & (BF_READ_PARTIAL|BF_OUT_EMPTY)) == BF_READ_PARTIAL) && |
Willy Tarreau | 3488e25 | 2010-08-09 16:24:56 +0200 | [diff] [blame] | 138 | (si->ib->cons->flags & SI_FL_WAIT_DATA)) { |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 139 | si->ib->cons->chk_snd(si->ib->cons); |
Willy Tarreau | 3488e25 | 2010-08-09 16:24:56 +0200 | [diff] [blame] | 140 | /* check if the consumer has freed some space */ |
| 141 | if (!(si->ib->flags & BF_FULL)) |
| 142 | si->flags &= ~SI_FL_WAIT_ROOM; |
| 143 | } |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 144 | |
| 145 | /* Note that we're trying to wake up in two conditions here : |
| 146 | * - special event, which needs the holder task attention |
| 147 | * - status indicating that the applet can go on working. This |
| 148 | * is rather hard because we might be blocking on output and |
| 149 | * don't want to wake up on input and vice-versa. The idea is |
Willy Tarreau | 3488e25 | 2010-08-09 16:24:56 +0200 | [diff] [blame] | 150 | * to only rely on the changes the chk_* might have performed. |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 151 | */ |
| 152 | if (/* check stream interface changes */ |
Willy Tarreau | 3488e25 | 2010-08-09 16:24:56 +0200 | [diff] [blame] | 153 | ((old_flags & ~si->flags) & (SI_FL_WAIT_ROOM|SI_FL_WAIT_DATA)) || |
| 154 | |
| 155 | /* changes on the production side */ |
| 156 | (si->ib->flags & (BF_READ_NULL|BF_READ_ERROR)) || |
| 157 | si->state != SI_ST_EST || |
| 158 | (si->flags & SI_FL_ERR) || |
| 159 | ((si->ib->flags & BF_READ_PARTIAL) && |
| 160 | (!si->ib->to_forward || si->ib->cons->state != SI_ST_EST)) || |
| 161 | |
| 162 | /* changes on the consumption side */ |
| 163 | (si->ob->flags & (BF_WRITE_NULL|BF_WRITE_ERROR)) || |
| 164 | ((si->ob->flags & BF_WRITE_ACTIVITY) && |
| 165 | ((si->ob->flags & BF_SHUTW) || |
| 166 | si->ob->prod->state != SI_ST_EST || |
| 167 | ((si->ob->flags & BF_OUT_EMPTY) && !si->ob->to_forward)))) { |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 168 | if (!(si->flags & SI_FL_DONT_WAKE) && si->owner) |
| 169 | task_wakeup(si->owner, TASK_WOKEN_IO); |
| 170 | } |
Willy Tarreau | 3488e25 | 2010-08-09 16:24:56 +0200 | [diff] [blame] | 171 | if (si->ib->flags & BF_READ_ACTIVITY) |
| 172 | si->ib->flags &= ~BF_READ_DONTWAIT; |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | /* default shutr function for scheduled tasks */ |
| 176 | void stream_int_shutr(struct stream_interface *si) |
| 177 | { |
| 178 | DPRINTF(stderr, "%s: si=%p, si->state=%d ib->flags=%08x ob->flags=%08x\n", |
| 179 | __FUNCTION__, |
| 180 | si, si->state, si->ib->flags, si->ob->flags); |
| 181 | |
| 182 | si->ib->flags &= ~BF_SHUTR_NOW; |
| 183 | if (si->ib->flags & BF_SHUTR) |
| 184 | return; |
| 185 | si->ib->flags |= BF_SHUTR; |
| 186 | si->ib->rex = TICK_ETERNITY; |
| 187 | si->flags &= ~SI_FL_WAIT_ROOM; |
| 188 | |
| 189 | if (si->state != SI_ST_EST && si->state != SI_ST_CON) |
| 190 | return; |
| 191 | |
| 192 | if (si->ob->flags & BF_SHUTW) { |
| 193 | si->state = SI_ST_DIS; |
| 194 | si->exp = TICK_ETERNITY; |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 195 | |
Willy Tarreau | d8ccffe | 2010-09-07 16:16:50 +0200 | [diff] [blame] | 196 | if (si->release) |
| 197 | si->release(si); |
| 198 | } |
Willy Tarreau | 0bd05ea | 2010-07-02 11:18:03 +0200 | [diff] [blame] | 199 | |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 200 | /* note that if the task exist, it must unregister itself once it runs */ |
| 201 | if (!(si->flags & SI_FL_DONT_WAKE) && si->owner) |
| 202 | task_wakeup(si->owner, TASK_WOKEN_IO); |
| 203 | } |
| 204 | |
| 205 | /* default shutw function for scheduled tasks */ |
| 206 | void stream_int_shutw(struct stream_interface *si) |
| 207 | { |
| 208 | DPRINTF(stderr, "%s: si=%p, si->state=%d ib->flags=%08x ob->flags=%08x\n", |
| 209 | __FUNCTION__, |
| 210 | si, si->state, si->ib->flags, si->ob->flags); |
| 211 | |
| 212 | si->ob->flags &= ~BF_SHUTW_NOW; |
| 213 | if (si->ob->flags & BF_SHUTW) |
| 214 | return; |
| 215 | si->ob->flags |= BF_SHUTW; |
| 216 | si->ob->wex = TICK_ETERNITY; |
| 217 | si->flags &= ~SI_FL_WAIT_DATA; |
| 218 | |
| 219 | switch (si->state) { |
| 220 | case SI_ST_EST: |
Willy Tarreau | f1ba4b3 | 2009-10-17 14:37:52 +0200 | [diff] [blame] | 221 | if (!(si->ib->flags & (BF_SHUTR|BF_DONT_READ))) |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 222 | break; |
| 223 | |
| 224 | /* fall through */ |
| 225 | case SI_ST_CON: |
| 226 | case SI_ST_CER: |
| 227 | si->state = SI_ST_DIS; |
| 228 | /* fall through */ |
Willy Tarreau | d8ccffe | 2010-09-07 16:16:50 +0200 | [diff] [blame] | 229 | |
| 230 | if (si->release) |
| 231 | si->release(si); |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 232 | default: |
| 233 | si->flags &= ~SI_FL_WAIT_ROOM; |
| 234 | si->ib->flags |= BF_SHUTR; |
| 235 | si->ib->rex = TICK_ETERNITY; |
| 236 | si->exp = TICK_ETERNITY; |
| 237 | } |
| 238 | |
| 239 | /* note that if the task exist, it must unregister itself once it runs */ |
| 240 | if (!(si->flags & SI_FL_DONT_WAKE) && si->owner) |
| 241 | task_wakeup(si->owner, TASK_WOKEN_IO); |
| 242 | } |
| 243 | |
| 244 | /* default chk_rcv function for scheduled tasks */ |
| 245 | void stream_int_chk_rcv(struct stream_interface *si) |
| 246 | { |
| 247 | struct buffer *ib = si->ib; |
| 248 | |
| 249 | DPRINTF(stderr, "%s: si=%p, si->state=%d ib->flags=%08x ob->flags=%08x\n", |
| 250 | __FUNCTION__, |
| 251 | si, si->state, si->ib->flags, si->ob->flags); |
| 252 | |
| 253 | if (unlikely(si->state != SI_ST_EST || (ib->flags & BF_SHUTR))) |
| 254 | return; |
| 255 | |
Willy Tarreau | f1ba4b3 | 2009-10-17 14:37:52 +0200 | [diff] [blame] | 256 | if (ib->flags & (BF_FULL|BF_HIJACK|BF_DONT_READ)) { |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 257 | /* stop reading */ |
Willy Tarreau | f1ba4b3 | 2009-10-17 14:37:52 +0200 | [diff] [blame] | 258 | if ((ib->flags & (BF_FULL|BF_HIJACK|BF_DONT_READ)) == BF_FULL) |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 259 | si->flags |= SI_FL_WAIT_ROOM; |
| 260 | } |
| 261 | else { |
| 262 | /* (re)start reading */ |
| 263 | si->flags &= ~SI_FL_WAIT_ROOM; |
| 264 | if (!(si->flags & SI_FL_DONT_WAKE) && si->owner) |
| 265 | task_wakeup(si->owner, TASK_WOKEN_IO); |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | /* default chk_snd function for scheduled tasks */ |
| 270 | void stream_int_chk_snd(struct stream_interface *si) |
| 271 | { |
| 272 | struct buffer *ob = si->ob; |
| 273 | |
| 274 | DPRINTF(stderr, "%s: si=%p, si->state=%d ib->flags=%08x ob->flags=%08x\n", |
| 275 | __FUNCTION__, |
| 276 | si, si->state, si->ib->flags, si->ob->flags); |
| 277 | |
| 278 | if (unlikely(si->state != SI_ST_EST || (si->ob->flags & BF_SHUTW))) |
| 279 | return; |
| 280 | |
| 281 | if (!(si->flags & SI_FL_WAIT_DATA) || /* not waiting for data */ |
| 282 | (ob->flags & BF_OUT_EMPTY)) /* called with nothing to send ! */ |
| 283 | return; |
| 284 | |
| 285 | /* Otherwise there are remaining data to be sent in the buffer, |
| 286 | * so we tell the handler. |
| 287 | */ |
| 288 | si->flags &= ~SI_FL_WAIT_DATA; |
| 289 | if (!tick_isset(ob->wex)) |
| 290 | ob->wex = tick_add_ifset(now_ms, ob->wto); |
| 291 | |
| 292 | if (!(si->flags & SI_FL_DONT_WAKE) && si->owner) |
| 293 | task_wakeup(si->owner, TASK_WOKEN_IO); |
| 294 | } |
| 295 | |
| 296 | /* Register a function to handle a stream_interface as part of the stream |
| 297 | * interface's owner task, which is returned. The SI will wake it up everytime |
| 298 | * it is solicited. The task's processing function must call the specified |
| 299 | * function before returning. It must be deleted by the task handler using |
| 300 | * stream_int_unregister_handler(), possibly from withing the function itself. |
| 301 | */ |
| 302 | struct task *stream_int_register_handler(struct stream_interface *si, |
| 303 | void (*fct)(struct stream_interface *)) |
| 304 | { |
| 305 | DPRINTF(stderr, "registering handler %p for si %p (was %p)\n", fct, si, si->owner); |
| 306 | |
| 307 | si->update = stream_int_update_embedded; |
| 308 | si->shutr = stream_int_shutr; |
| 309 | si->shutw = stream_int_shutw; |
| 310 | si->chk_rcv = stream_int_chk_rcv; |
| 311 | si->chk_snd = stream_int_chk_snd; |
| 312 | si->connect = NULL; |
| 313 | si->iohandler = fct; |
Willy Tarreau | 0bd05ea | 2010-07-02 11:18:03 +0200 | [diff] [blame] | 314 | si->release = NULL; |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 315 | si->flags |= SI_FL_WAIT_DATA; |
| 316 | return si->owner; |
| 317 | } |
| 318 | |
| 319 | /* Register a function to handle a stream_interface as a standalone task. The |
| 320 | * new task itself is returned and is assigned as si->owner. The stream_interface |
| 321 | * pointer will be pointed to by the task's context. The handler can be detached |
| 322 | * by using stream_int_unregister_handler(). |
| 323 | */ |
| 324 | struct task *stream_int_register_handler_task(struct stream_interface *si, |
| 325 | struct task *(*fct)(struct task *)) |
| 326 | { |
| 327 | struct task *t; |
| 328 | |
| 329 | DPRINTF(stderr, "registering handler %p for si %p (was %p)\n", fct, si, si->owner); |
| 330 | |
| 331 | si->update = stream_int_update; |
| 332 | si->shutr = stream_int_shutr; |
| 333 | si->shutw = stream_int_shutw; |
| 334 | si->chk_rcv = stream_int_chk_rcv; |
| 335 | si->chk_snd = stream_int_chk_snd; |
| 336 | si->connect = NULL; |
| 337 | si->iohandler = NULL; /* not used when running as an external task */ |
Willy Tarreau | 0bd05ea | 2010-07-02 11:18:03 +0200 | [diff] [blame] | 338 | si->release = NULL; |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 339 | si->flags |= SI_FL_WAIT_DATA; |
| 340 | |
| 341 | t = task_new(); |
| 342 | si->owner = t; |
| 343 | if (!t) |
| 344 | return t; |
| 345 | t->process = fct; |
| 346 | t->context = si; |
| 347 | task_wakeup(si->owner, TASK_WOKEN_INIT); |
| 348 | |
| 349 | return t; |
| 350 | } |
| 351 | |
| 352 | /* Unregister a stream interface handler. This must be called by the handler task |
| 353 | * itself when it detects that it is in the SI_ST_DIS state. This function can |
| 354 | * both detach standalone handlers and embedded handlers. |
| 355 | */ |
| 356 | void stream_int_unregister_handler(struct stream_interface *si) |
| 357 | { |
| 358 | if (!si->iohandler && si->owner) { |
| 359 | /* external handler : kill the task */ |
| 360 | task_delete(si->owner); |
| 361 | task_free(si->owner); |
| 362 | } |
| 363 | si->iohandler = NULL; |
Willy Tarreau | 0bd05ea | 2010-07-02 11:18:03 +0200 | [diff] [blame] | 364 | si->release = NULL; |
Willy Tarreau | fb90d94 | 2009-09-05 20:57:35 +0200 | [diff] [blame] | 365 | si->owner = NULL; |
| 366 | } |
| 367 | |
Willy Tarreau | dded32d | 2008-11-30 19:48:07 +0100 | [diff] [blame] | 368 | /* |
Willy Tarreau | cff6411 | 2008-11-03 06:26:53 +0100 | [diff] [blame] | 369 | * Local variables: |
| 370 | * c-indent-level: 8 |
| 371 | * c-basic-offset: 8 |
| 372 | * End: |
| 373 | */ |