blob: b35b9fe76723bc5428d26cad67de0e65fd91633a [file] [log] [blame]
Willy Tarreaubaaee002006-06-26 02:48:02 +02001/*
2 * Functions operating on SOCK_STREAM and buffers.
3 *
Willy Tarreau0c303ee2008-07-07 00:09:58 +02004 * Copyright 2000-2008 Willy Tarreau <w@1wt.eu>
Willy Tarreaubaaee002006-06-26 02:48:02 +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
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
Willy Tarreau2dd0d472006-06-29 17:53:05 +020022#include <common/compat.h>
Willy Tarreaue3ba5f02006-06-29 18:54:54 +020023#include <common/config.h>
Willy Tarreaud6f087e2008-01-18 17:20:13 +010024#include <common/debug.h>
Willy Tarreau83749182007-04-15 20:56:27 +020025#include <common/standard.h>
Willy Tarreau0c303ee2008-07-07 00:09:58 +020026#include <common/ticks.h>
Willy Tarreau2dd0d472006-06-29 17:53:05 +020027#include <common/time.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020028
Willy Tarreaubaaee002006-06-26 02:48:02 +020029#include <proto/client.h>
30#include <proto/fd.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020031#include <proto/stream_sock.h>
32#include <proto/task.h>
33
34
35/*
Willy Tarreaud7971282006-07-29 18:36:34 +020036 * this function is called on a read event from a stream socket.
Willy Tarreau83749182007-04-15 20:56:27 +020037 * It returns 0 if we have a high confidence that we will not be
38 * able to read more data without polling first. Returns non-zero
39 * otherwise.
Willy Tarreaubaaee002006-06-26 02:48:02 +020040 */
Willy Tarreaud7971282006-07-29 18:36:34 +020041int stream_sock_read(int fd) {
Willy Tarreau0c303ee2008-07-07 00:09:58 +020042 __label__ out_wakeup, out_shutdown_r, out_error;
Willy Tarreau54469402006-07-29 16:59:06 +020043 struct buffer *b = fdtab[fd].cb[DIR_RD].b;
Willy Tarreau8a7af602008-05-03 23:07:14 +020044 int ret, max, retval, cur_read;
Willy Tarreaub8949f12007-03-23 22:39:59 +010045 int read_poll = MAX_READ_POLL_LOOPS;
Willy Tarreaubaaee002006-06-26 02:48:02 +020046
47#ifdef DEBUG_FULL
Willy Tarreaud6f087e2008-01-18 17:20:13 +010048 fprintf(stderr,"stream_sock_read : fd=%d, ev=0x%02x, owner=%p\n", fd, fdtab[fd].ev, fdtab[fd].owner);
Willy Tarreaubaaee002006-06-26 02:48:02 +020049#endif
50
Willy Tarreau83749182007-04-15 20:56:27 +020051 retval = 1;
52
Willy Tarreaud6f087e2008-01-18 17:20:13 +010053 /* stop immediately on errors */
54 if (fdtab[fd].state == FD_STERROR || (fdtab[fd].ev & FD_POLL_ERR))
Willy Tarreau6996e152007-04-30 14:37:43 +020055 goto out_error;
Willy Tarreaud6f087e2008-01-18 17:20:13 +010056
57 /* stop here if we reached the end of data */
58 if ((fdtab[fd].ev & (FD_POLL_IN|FD_POLL_HUP)) == FD_POLL_HUP)
59 goto out_shutdown_r;
Willy Tarreau83749182007-04-15 20:56:27 +020060
Willy Tarreau8a7af602008-05-03 23:07:14 +020061 cur_read = 0;
Willy Tarreau6996e152007-04-30 14:37:43 +020062 while (1) {
63 /*
64 * 1. compute the maximum block size we can read at once.
65 */
Willy Tarreau83749182007-04-15 20:56:27 +020066 if (b->l == 0) { /* let's realign the buffer to optimize I/O */
67 b->r = b->w = b->lr = b->data;
68 max = b->rlim - b->data;
69 }
70 else if (b->r > b->w) {
71 max = b->rlim - b->r;
72 }
73 else {
74 max = b->w - b->r;
75 /* FIXME: theorically, if w>0, we shouldn't have rlim < data+size anymore
76 * since it means that the rewrite protection has been removed. This
77 * implies that the if statement can be removed.
78 */
79 if (max > b->rlim - b->data)
Willy Tarreaubaaee002006-06-26 02:48:02 +020080 max = b->rlim - b->data;
Willy Tarreau83749182007-04-15 20:56:27 +020081 }
Willy Tarreaubaaee002006-06-26 02:48:02 +020082
Willy Tarreau6996e152007-04-30 14:37:43 +020083 if (unlikely(max == 0)) {
84 /* Not anymore room to store data. This should theorically
85 * never happen, but better safe than sorry !
86 */
Willy Tarreaue393fe22008-08-16 22:18:07 +020087 b->flags |= BF_FULL;
Willy Tarreau83749182007-04-15 20:56:27 +020088 EV_FD_CLR(fd, DIR_RD);
Willy Tarreau0c303ee2008-07-07 00:09:58 +020089 b->rex = TICK_ETERNITY;
90 goto out_wakeup;
Willy Tarreau83749182007-04-15 20:56:27 +020091 }
Willy Tarreaubaaee002006-06-26 02:48:02 +020092
Willy Tarreau6996e152007-04-30 14:37:43 +020093 /*
94 * 2. read the largest possible block
95 */
Willy Tarreaubaaee002006-06-26 02:48:02 +020096#ifndef MSG_NOSIGNAL
Willy Tarreau83749182007-04-15 20:56:27 +020097 {
98 int skerr;
99 socklen_t lskerr = sizeof(skerr);
100
101 ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &skerr, &lskerr);
102 if (ret == -1 || skerr)
103 ret = -1;
104 else
105 ret = recv(fd, b->r, max, 0);
106 }
Willy Tarreaubaaee002006-06-26 02:48:02 +0200107#else
Willy Tarreau83749182007-04-15 20:56:27 +0200108 ret = recv(fd, b->r, max, MSG_NOSIGNAL);
Willy Tarreaubaaee002006-06-26 02:48:02 +0200109#endif
Willy Tarreau83749182007-04-15 20:56:27 +0200110 if (ret > 0) {
111 b->r += ret;
112 b->l += ret;
Willy Tarreau8a7af602008-05-03 23:07:14 +0200113 cur_read += ret;
Willy Tarreau83749182007-04-15 20:56:27 +0200114 b->flags |= BF_PARTIAL_READ;
Willy Tarreaue393fe22008-08-16 22:18:07 +0200115 b->flags &= ~BF_EMPTY;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200116
Willy Tarreau83749182007-04-15 20:56:27 +0200117 if (b->r == b->data + BUFSIZE) {
118 b->r = b->data; /* wrap around the buffer */
119 }
Willy Tarreau9641e8f2007-03-23 23:02:09 +0100120
Willy Tarreau83749182007-04-15 20:56:27 +0200121 b->total += ret;
Willy Tarreau9641e8f2007-03-23 23:02:09 +0100122
Willy Tarreaue393fe22008-08-16 22:18:07 +0200123 if (b->l >= b->rlim - b->data) {
Willy Tarreau6996e152007-04-30 14:37:43 +0200124 /* The buffer is now full, there's no point in going through
125 * the loop again.
126 */
Willy Tarreau8a7af602008-05-03 23:07:14 +0200127 if (!(b->flags & BF_STREAMER_FAST) && (cur_read == b->l)) {
128 b->xfer_small = 0;
129 b->xfer_large++;
130 if (b->xfer_large >= 3) {
131 /* we call this buffer a fast streamer if it manages
132 * to be filled in one call 3 consecutive times.
133 */
134 b->flags |= (BF_STREAMER | BF_STREAMER_FAST);
135 //fputc('+', stderr);
136 }
137 }
138 else if ((b->flags & (BF_STREAMER | BF_STREAMER_FAST)) &&
139 (cur_read <= BUFSIZE / 2)) {
140 b->xfer_large = 0;
141 b->xfer_small++;
142 if (b->xfer_small >= 2) {
143 /* if the buffer has been at least half full twice,
144 * we receive faster than we send, so at least it
145 * is not a "fast streamer".
146 */
147 b->flags &= ~BF_STREAMER_FAST;
148 //fputc('-', stderr);
149 }
150 }
151 else {
152 b->xfer_small = 0;
153 b->xfer_large = 0;
154 }
155
Willy Tarreaue393fe22008-08-16 22:18:07 +0200156 b->flags |= BF_FULL;
Willy Tarreau6996e152007-04-30 14:37:43 +0200157 EV_FD_CLR(fd, DIR_RD);
Willy Tarreau0c303ee2008-07-07 00:09:58 +0200158 b->rex = TICK_ETERNITY;
159 goto out_wakeup;
Willy Tarreau6996e152007-04-30 14:37:43 +0200160 }
161
Willy Tarreauab3e1d32007-06-03 14:10:36 +0200162 /* if too many bytes were missing from last read, it means that
163 * it's pointless trying to read again because the system does
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100164 * not have them in buffers. BTW, if FD_POLL_HUP was present,
165 * it means that we have reached the end and that the connection
166 * is closed.
Willy Tarreauab3e1d32007-06-03 14:10:36 +0200167 */
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100168 if (ret < max) {
Willy Tarreau8a7af602008-05-03 23:07:14 +0200169 if ((b->flags & (BF_STREAMER | BF_STREAMER_FAST)) &&
170 (cur_read <= BUFSIZE / 2)) {
171 b->xfer_large = 0;
172 b->xfer_small++;
173 if (b->xfer_small >= 3) {
174 /* we have read less than half of the buffer in
175 * one pass, and this happened at least 3 times.
176 * This is definitely not a streamer.
177 */
178 b->flags &= ~(BF_STREAMER | BF_STREAMER_FAST);
179 //fputc('!', stderr);
180 }
181 }
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100182 if (fdtab[fd].ev & FD_POLL_HUP)
183 goto out_shutdown_r;
Willy Tarreauab3e1d32007-06-03 14:10:36 +0200184 break;
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100185 }
Willy Tarreauab3e1d32007-06-03 14:10:36 +0200186
187 /* generally if we read something smaller than 1 or 2 MSS,
Willy Tarreau83749182007-04-15 20:56:27 +0200188 * it means that it's not worth trying to read again. It may
189 * also happen on headers, but the application then can stop
190 * reading before we start polling.
191 */
192 if (ret < MIN_RET_FOR_READ_LOOP)
Willy Tarreaubaaee002006-06-26 02:48:02 +0200193 break;
Willy Tarreau83749182007-04-15 20:56:27 +0200194
Willy Tarreau6996e152007-04-30 14:37:43 +0200195 if (--read_poll <= 0)
Willy Tarreaubaaee002006-06-26 02:48:02 +0200196 break;
Willy Tarreau83749182007-04-15 20:56:27 +0200197
Willy Tarreau83749182007-04-15 20:56:27 +0200198 }
199 else if (ret == 0) {
Willy Tarreau6996e152007-04-30 14:37:43 +0200200 /* connection closed */
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100201 goto out_shutdown_r;
Willy Tarreau83749182007-04-15 20:56:27 +0200202 }
Willy Tarreau9f195292007-04-15 21:26:58 +0200203 else if (errno == EAGAIN) {
204 /* Ignore EAGAIN but inform the poller that there is
Willy Tarreau6996e152007-04-30 14:37:43 +0200205 * nothing to read left. But we may have done some work
206 * justifying to notify the task.
Willy Tarreau9f195292007-04-15 21:26:58 +0200207 */
Willy Tarreau83749182007-04-15 20:56:27 +0200208 retval = 0;
209 break;
210 }
211 else {
Willy Tarreau6996e152007-04-30 14:37:43 +0200212 goto out_error;
Willy Tarreau83749182007-04-15 20:56:27 +0200213 }
Willy Tarreau6996e152007-04-30 14:37:43 +0200214 } /* while (1) */
Willy Tarreaubaaee002006-06-26 02:48:02 +0200215
Willy Tarreau6996e152007-04-30 14:37:43 +0200216 /*
217 * The only way to get out of this loop is to have stopped reading
218 * without any error nor close, either by limiting the number of
219 * loops, or because of an EAGAIN. We only rearm the timer if we
220 * have at least read something.
221 */
222
Willy Tarreauadfb8562008-08-11 15:24:42 +0200223 if (tick_isset(b->rex) && b->flags & BF_PARTIAL_READ)
Willy Tarreau0c303ee2008-07-07 00:09:58 +0200224 b->rex = tick_add_ifset(now_ms, b->rto);
Willy Tarreaubaaee002006-06-26 02:48:02 +0200225
Willy Tarreau6996e152007-04-30 14:37:43 +0200226 out_wakeup:
227 if (b->flags & BF_READ_STATUS)
228 task_wakeup(fdtab[fd].owner);
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100229 fdtab[fd].ev &= ~FD_POLL_IN;
Willy Tarreau83749182007-04-15 20:56:27 +0200230 return retval;
Willy Tarreau6996e152007-04-30 14:37:43 +0200231
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100232 out_shutdown_r:
233 fdtab[fd].ev &= ~FD_POLL_HUP;
234 b->flags |= BF_READ_NULL;
Willy Tarreau0c303ee2008-07-07 00:09:58 +0200235 b->rex = TICK_ETERNITY;
236 goto out_wakeup;
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100237
Willy Tarreau6996e152007-04-30 14:37:43 +0200238 out_error:
239 /* There was an error. we must wakeup the task. No need to clear
240 * the events, the task will do it.
241 */
242 fdtab[fd].state = FD_STERROR;
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100243 fdtab[fd].ev &= ~FD_POLL_STICKY;
Willy Tarreau6996e152007-04-30 14:37:43 +0200244 b->flags |= BF_READ_ERROR;
Willy Tarreau0c303ee2008-07-07 00:09:58 +0200245 b->rex = TICK_ETERNITY;
246 goto out_wakeup;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200247}
248
249
250/*
Willy Tarreauf8306d52006-07-29 19:01:31 +0200251 * this function is called on a write event from a stream socket.
Willy Tarreau83749182007-04-15 20:56:27 +0200252 * It returns 0 if we have a high confidence that we will not be
253 * able to write more data without polling first. Returns non-zero
254 * otherwise.
Willy Tarreaubaaee002006-06-26 02:48:02 +0200255 */
Willy Tarreauf8306d52006-07-29 19:01:31 +0200256int stream_sock_write(int fd) {
Willy Tarreau0c303ee2008-07-07 00:09:58 +0200257 __label__ out_wakeup, out_error;
Willy Tarreau54469402006-07-29 16:59:06 +0200258 struct buffer *b = fdtab[fd].cb[DIR_WR].b;
Willy Tarreau83749182007-04-15 20:56:27 +0200259 int ret, max, retval;
260 int write_poll = MAX_WRITE_POLL_LOOPS;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200261
262#ifdef DEBUG_FULL
Willy Tarreauf8306d52006-07-29 19:01:31 +0200263 fprintf(stderr,"stream_sock_write : fd=%d, owner=%p\n", fd, fdtab[fd].owner);
Willy Tarreaubaaee002006-06-26 02:48:02 +0200264#endif
265
Willy Tarreau83749182007-04-15 20:56:27 +0200266 retval = 1;
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100267 if (fdtab[fd].state == FD_STERROR || (fdtab[fd].ev & FD_POLL_ERR))
Willy Tarreau6996e152007-04-30 14:37:43 +0200268 goto out_error;
Willy Tarreau83749182007-04-15 20:56:27 +0200269
Willy Tarreau6996e152007-04-30 14:37:43 +0200270 while (1) {
Willy Tarreau83749182007-04-15 20:56:27 +0200271 if (b->l == 0) { /* let's realign the buffer to optimize I/O */
272 b->r = b->w = b->lr = b->data;
273 max = 0;
274 }
275 else if (b->r > b->w) {
276 max = b->r - b->w;
277 }
278 else {
279 max = b->data + BUFSIZE - b->w;
280 }
281
Willy Tarreaubaaee002006-06-26 02:48:02 +0200282 if (max == 0) {
Willy Tarreauf8306d52006-07-29 19:01:31 +0200283 /* may be we have received a connection acknowledgement in TCP mode without data */
Willy Tarreau6996e152007-04-30 14:37:43 +0200284 if (likely(fdtab[fd].state == FD_STCONN)) {
Willy Tarreau6996e152007-04-30 14:37:43 +0200285 /* We have no data to send to check the connection, and
286 * getsockopt() will not inform us whether the connection
287 * is still pending. So we'll reuse connect() to check the
288 * state of the socket. This has the advantage of givig us
289 * the following info :
290 * - error
291 * - connecting (EALREADY, EINPROGRESS)
292 * - connected (EISCONN, 0)
293 */
Willy Tarreaue94ebd02007-10-09 17:14:37 +0200294 if ((connect(fd, fdtab[fd].peeraddr, fdtab[fd].peerlen) == 0))
Willy Tarreau6996e152007-04-30 14:37:43 +0200295 errno = 0;
296
297 if (errno == EALREADY || errno == EINPROGRESS) {
298 retval = 0;
299 goto out_wakeup;
Willy Tarreauf8306d52006-07-29 19:01:31 +0200300 }
Willy Tarreau6996e152007-04-30 14:37:43 +0200301
302 if (errno && errno != EISCONN)
303 goto out_error;
304
305 /* OK we just need to indicate that we got a connection
306 * and that we wrote nothing.
307 */
308 b->flags |= BF_WRITE_NULL;
309 fdtab[fd].state = FD_STREADY;
Willy Tarreauf8306d52006-07-29 19:01:31 +0200310 }
311
Willy Tarreau6996e152007-04-30 14:37:43 +0200312 /* Funny, we were called to write something but there wasn't
313 * anything. Theorically we cannot get there, but just in case,
314 * let's disable the write event and pretend we never came there.
315 */
Willy Tarreauf161a342007-04-08 16:59:42 +0200316 EV_FD_CLR(fd, DIR_WR);
Willy Tarreau0c303ee2008-07-07 00:09:58 +0200317 b->wex = TICK_ETERNITY;
318 goto out_wakeup;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200319 }
320
321#ifndef MSG_NOSIGNAL
322 {
323 int skerr;
324 socklen_t lskerr = sizeof(skerr);
325
Willy Tarreauc6423482006-10-15 14:59:03 +0200326 ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &skerr, &lskerr);
327 if (ret == -1 || skerr)
Willy Tarreaubaaee002006-06-26 02:48:02 +0200328 ret = -1;
329 else
330 ret = send(fd, b->w, max, MSG_DONTWAIT);
331 }
332#else
333 ret = send(fd, b->w, max, MSG_DONTWAIT | MSG_NOSIGNAL);
334#endif
335
336 if (ret > 0) {
337 b->l -= ret;
338 b->w += ret;
339
Willy Tarreau0f9f5052006-07-29 17:39:25 +0200340 b->flags |= BF_PARTIAL_WRITE;
Willy Tarreaue393fe22008-08-16 22:18:07 +0200341
342 if (b->l < b->rlim - b->data)
343 b->flags &= ~BF_FULL;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200344
345 if (b->w == b->data + BUFSIZE) {
346 b->w = b->data; /* wrap around the buffer */
347 }
Willy Tarreau83749182007-04-15 20:56:27 +0200348
Willy Tarreau6996e152007-04-30 14:37:43 +0200349 if (!b->l) {
Willy Tarreaue393fe22008-08-16 22:18:07 +0200350 b->flags |= BF_EMPTY;
Willy Tarreau6996e152007-04-30 14:37:43 +0200351 EV_FD_CLR(fd, DIR_WR);
Willy Tarreau0c303ee2008-07-07 00:09:58 +0200352 b->wex = TICK_ETERNITY;
353 goto out_wakeup;
Willy Tarreau6996e152007-04-30 14:37:43 +0200354 }
Willy Tarreau83749182007-04-15 20:56:27 +0200355
Willy Tarreauab3e1d32007-06-03 14:10:36 +0200356 /* if the system buffer is full, don't insist */
357 if (ret < max)
358 break;
359
Willy Tarreau6996e152007-04-30 14:37:43 +0200360 if (--write_poll <= 0)
361 break;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200362 }
Willy Tarreau6996e152007-04-30 14:37:43 +0200363 else if (ret == 0 || errno == EAGAIN) {
364 /* nothing written, just pretend we were never called
365 * and wait for the socket to be ready. But we may have
366 * done some work justifying to notify the task.
367 */
Willy Tarreau83749182007-04-15 20:56:27 +0200368 retval = 0;
369 break;
370 }
Willy Tarreaubaaee002006-06-26 02:48:02 +0200371 else {
Willy Tarreau6996e152007-04-30 14:37:43 +0200372 goto out_error;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200373 }
Willy Tarreau6996e152007-04-30 14:37:43 +0200374 } /* while (1) */
Willy Tarreaubaaee002006-06-26 02:48:02 +0200375
Willy Tarreau6996e152007-04-30 14:37:43 +0200376 /*
377 * The only way to get out of this loop is to have stopped writing
378 * without any error, either by limiting the number of loops, or
379 * because of an EAGAIN. We only rearm the timer if we have at least
380 * written something.
381 */
382
Willy Tarreauadfb8562008-08-11 15:24:42 +0200383 if (tick_isset(b->wex) && b->flags & BF_PARTIAL_WRITE) {
Willy Tarreau0c303ee2008-07-07 00:09:58 +0200384 b->wex = tick_add_ifset(now_ms, b->wto);
Willy Tarreauadfb8562008-08-11 15:24:42 +0200385 if (tick_isset(b->wex)) {
Willy Tarreau83749182007-04-15 20:56:27 +0200386 /* FIXME: to prevent the client from expiring read timeouts during writes,
387 * we refresh it. A solution would be to merge read+write timeouts into a
388 * unique one, although that needs some study particularly on full-duplex
389 * TCP connections. */
Willy Tarreauba392ce2008-08-16 21:13:23 +0200390 if (tick_isset(b->rex) && !(b->flags & BF_SHUTR))
Willy Tarreaufa645582007-06-03 15:59:52 +0200391 b->rex = b->wex;
Willy Tarreau83749182007-04-15 20:56:27 +0200392 }
Willy Tarreaubaaee002006-06-26 02:48:02 +0200393 }
Willy Tarreaubaaee002006-06-26 02:48:02 +0200394
Willy Tarreau6996e152007-04-30 14:37:43 +0200395 out_wakeup:
396 if (b->flags & BF_WRITE_STATUS)
397 task_wakeup(fdtab[fd].owner);
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100398 fdtab[fd].ev &= ~FD_POLL_OUT;
Willy Tarreau83749182007-04-15 20:56:27 +0200399 return retval;
Willy Tarreau6996e152007-04-30 14:37:43 +0200400
401 out_error:
402 /* There was an error. we must wakeup the task. No need to clear
403 * the events, the task will do it.
404 */
405 fdtab[fd].state = FD_STERROR;
Willy Tarreaud6f087e2008-01-18 17:20:13 +0100406 fdtab[fd].ev &= ~FD_POLL_STICKY;
Willy Tarreau6996e152007-04-30 14:37:43 +0200407 b->flags |= BF_WRITE_ERROR;
Willy Tarreau0c303ee2008-07-07 00:09:58 +0200408 b->wex = TICK_ETERNITY;
409 goto out_wakeup;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200410}
411
Willy Tarreaubaaee002006-06-26 02:48:02 +0200412
413
414/*
415 * Local variables:
416 * c-indent-level: 8
417 * c-basic-offset: 8
418 * End:
419 */