haproxy: re-enable polling on listener() when memory shortage occours after accept
authorThomas Heil <heil@terminal-consulting.de>
Tue, 21 Sep 2010 22:06:37 +0000 (22:06 +0000)
committerThomas Heil <heil@terminal-consulting.de>
Tue, 21 Sep 2010 22:06:37 +0000 (22:06 +0000)
 - thanks to Willy Tarreau <w@1wt.eu>

SVN-Revision: 23108

net/haproxy/Makefile
net/haproxy/patches/001-clean-listener-ressource-shortage.patch [new file with mode: 0644]

index fcd0243d9f715eea2f0af80bdb84f6f9bce0f31b..6959a8e11c62edfba50066065968cc2377ef52af 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haproxy
 PKG_VERSION:=1.4.8
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.4/src
diff --git a/net/haproxy/patches/001-clean-listener-ressource-shortage.patch b/net/haproxy/patches/001-clean-listener-ressource-shortage.patch
new file mode 100644 (file)
index 0000000..1299e5e
--- /dev/null
@@ -0,0 +1,38 @@
+--- a/src/client.c
++++ b/src/client.c
+@@ -1,7 +1,7 @@
+ /*
+  * Client-side variables and functions.
+  *
+- * Copyright 2000-2009 Willy Tarreau <w@1wt.eu>
++ * Copyright 2000-2010 Willy Tarreau <w@1wt.eu>
+  *
+  * This program is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License
+@@ -33,6 +33,7 @@
+ #include <proto/log.h>
+ #include <proto/hdr_idx.h>
+ #include <proto/pattern.h>
++#include <proto/protocols.h>
+ #include <proto/proto_tcp.h>
+ #include <proto/proto_http.h>
+ #include <proto/proxy.h>
+@@ -121,7 +122,7 @@ int event_accept(int fd) {
+               if ((s = pool_alloc2(pool2_session)) == NULL) { /* disable this proxy for a while */
+                       Alert("out of memory in event_accept().\n");
+-                      EV_FD_CLR(fd, DIR_RD);
++                      disable_listener(l);
+                       p->state = PR_STIDLE;
+                       goto out_close;
+               }
+@@ -149,7 +150,7 @@ int event_accept(int fd) {
+               if ((t = task_new()) == NULL) { /* disable this proxy for a while */
+                       Alert("out of memory in event_accept().\n");
+-                      EV_FD_CLR(fd, DIR_RD);
++                      disable_listener(l);
+                       p->state = PR_STIDLE;
+                       goto out_free_session;
+               }
+