From 08284f5a55c6f6f7c6b304f0e45f79841615868b Mon Sep 17 00:00:00 2001 From: heil Date: Tue, 21 Sep 2010 22:06:37 +0000 Subject: [PATCH] [packages] haproxy: re-enable polling on listener() when memory shortage occours after accept - thanks to Willy Tarreau git-svn-id: svn://svn.openwrt.org/openwrt/packages@23108 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/haproxy/Makefile | 2 +- ...01-clean-listener-ressource-shortage.patch | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 net/haproxy/patches/001-clean-listener-ressource-shortage.patch diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index fcd0243d9..6959a8e11 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -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 index 000000000..1299e5e26 --- /dev/null +++ b/net/haproxy/patches/001-clean-listener-ressource-shortage.patch @@ -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 ++ * Copyright 2000-2010 Willy Tarreau + * + * 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 + #include + #include ++#include + #include + #include + #include +@@ -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; + } +