[packages] haproxy: re-enable polling on listener() when memory shortage occours...
[openwrt/svn-archive/archive.git] / net / haproxy / patches / 001-clean-listener-ressource-shortage.patch
1 --- a/src/client.c
2 +++ b/src/client.c
3 @@ -1,7 +1,7 @@
4 /*
5 * Client-side variables and functions.
6 *
7 - * Copyright 2000-2009 Willy Tarreau <w@1wt.eu>
8 + * Copyright 2000-2010 Willy Tarreau <w@1wt.eu>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 @@ -33,6 +33,7 @@
13 #include <proto/log.h>
14 #include <proto/hdr_idx.h>
15 #include <proto/pattern.h>
16 +#include <proto/protocols.h>
17 #include <proto/proto_tcp.h>
18 #include <proto/proto_http.h>
19 #include <proto/proxy.h>
20 @@ -121,7 +122,7 @@ int event_accept(int fd) {
21
22 if ((s = pool_alloc2(pool2_session)) == NULL) { /* disable this proxy for a while */
23 Alert("out of memory in event_accept().\n");
24 - EV_FD_CLR(fd, DIR_RD);
25 + disable_listener(l);
26 p->state = PR_STIDLE;
27 goto out_close;
28 }
29 @@ -149,7 +150,7 @@ int event_accept(int fd) {
30
31 if ((t = task_new()) == NULL) { /* disable this proxy for a while */
32 Alert("out of memory in event_accept().\n");
33 - EV_FD_CLR(fd, DIR_RD);
34 + disable_listener(l);
35 p->state = PR_STIDLE;
36 goto out_free_session;
37 }
38