[pkg-lighttpd] r485 - in lighttpd/trunk: . debian src

Olaf van der Spek olafvdspek-guest at alioth.debian.org
Mon Aug 23 21:41:55 UTC 2010


Author: olafvdspek-guest
Date: 2010-08-23 21:41:54 +0000 (Mon, 23 Aug 2010)
New Revision: 485

Modified:
   lighttpd/trunk/NEWS
   lighttpd/trunk/SConstruct
   lighttpd/trunk/configure
   lighttpd/trunk/configure.ac
   lighttpd/trunk/debian/changelog
   lighttpd/trunk/src/buffer.h
   lighttpd/trunk/src/connections.c
   lighttpd/trunk/src/fdevent.c
   lighttpd/trunk/src/fdevent.h
   lighttpd/trunk/src/fdevent_freebsd_kqueue.c
   lighttpd/trunk/src/fdevent_libev.c
   lighttpd/trunk/src/fdevent_linux_sysepoll.c
   lighttpd/trunk/src/fdevent_poll.c
   lighttpd/trunk/src/fdevent_select.c
   lighttpd/trunk/src/fdevent_solaris_devpoll.c
   lighttpd/trunk/src/mod_cgi.c
   lighttpd/trunk/src/mod_fastcgi.c
   lighttpd/trunk/src/mod_proxy.c
   lighttpd/trunk/src/mod_scgi.c
   lighttpd/trunk/src/network.c
   lighttpd/trunk/src/server.c
Log:
Upstream 1.4.28


Modified: lighttpd/trunk/NEWS
===================================================================
--- lighttpd/trunk/NEWS	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/NEWS	2010-08-23 21:41:54 UTC (rev 485)
@@ -3,7 +3,11 @@
 NEWS
 ====
 
-- 1.4.27 -
+- 1.4.28 -
+  * Rename fdevent_event_add to _set to reflect what the function does. Fix some handlers. (fixes #2249)
+  * Fix buffer.h to include stdio.h as it is needer for SEGFAULT() (fixes #2250)
+
+- 1.4.27 - 2010-08-13
   * Fix handling return value of SSL_CTX_set_options (fixes #2157, thx mlcreech)
   * Fix mod_proxy HUP handling (send final chunk, fix usage counter)
   * mod_proxy: close connection on write error (fixes #2114)

Modified: lighttpd/trunk/SConstruct
===================================================================
--- lighttpd/trunk/SConstruct	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/SConstruct	2010-08-23 21:41:54 UTC (rev 485)
@@ -5,7 +5,7 @@
 from stat import *
 
 package = 'lighttpd'
-version = '1.4.27'
+version = '1.4.28'
 
 def checkCHeaders(autoconf, hdrs):
 	p = re.compile('[^A-Z0-9]')

Modified: lighttpd/trunk/configure
===================================================================
--- lighttpd/trunk/configure	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/configure	2010-08-23 21:41:54 UTC (rev 485)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for lighttpd 1.4.27.
+# Generated by GNU Autoconf 2.67 for lighttpd 1.4.28.
 #
 # Report bugs to <contact at lighttpd.net>.
 #
@@ -701,8 +701,8 @@
 # Identity of this package.
 PACKAGE_NAME='lighttpd'
 PACKAGE_TARNAME='lighttpd'
-PACKAGE_VERSION='1.4.27'
-PACKAGE_STRING='lighttpd 1.4.27'
+PACKAGE_VERSION='1.4.28'
+PACKAGE_STRING='lighttpd 1.4.28'
 PACKAGE_BUGREPORT='contact at lighttpd.net'
 PACKAGE_URL=''
 
@@ -1493,7 +1493,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures lighttpd 1.4.27 to adapt to many kinds of systems.
+\`configure' configures lighttpd 1.4.28 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1564,7 +1564,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of lighttpd 1.4.27:";;
+     short | recursive ) echo "Configuration of lighttpd 1.4.28:";;
    esac
   cat <<\_ACEOF
 
@@ -1706,7 +1706,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-lighttpd configure 1.4.27
+lighttpd configure 1.4.28
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2364,7 +2364,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by lighttpd $as_me 1.4.27, which was
+It was created by lighttpd $as_me 1.4.28, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -3295,7 +3295,7 @@
 
 # Define the identity of the package.
  PACKAGE='lighttpd'
- VERSION='1.4.27'
+ VERSION='1.4.28'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -15820,7 +15820,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by lighttpd $as_me 1.4.27, which was
+This file was extended by lighttpd $as_me 1.4.28, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15886,7 +15886,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-lighttpd config.status 1.4.27
+lighttpd config.status 1.4.28
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 

Modified: lighttpd/trunk/configure.ac
===================================================================
--- lighttpd/trunk/configure.ac	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/configure.ac	2010-08-23 21:41:54 UTC (rev 485)
@@ -1,7 +1,7 @@
 dnl                                               -*- Autoconf -*-
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.57)
-AC_INIT([lighttpd], [1.4.27], [contact at lighttpd.net])
+AC_INIT([lighttpd], [1.4.28], [contact at lighttpd.net])
 AC_CONFIG_SRCDIR([src/server.c])
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_MACRO_DIR([m4])

Modified: lighttpd/trunk/debian/changelog
===================================================================
--- lighttpd/trunk/debian/changelog	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/debian/changelog	2010-08-23 21:41:54 UTC (rev 485)
@@ -1,3 +1,9 @@
+lighttpd (1.4.28-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Olaf van der Spek <olaf at router>  Mon, 23 Aug 2010 23:41:04 +0200
+
 lighttpd (1.4.27-1) unstable; urgency=low
 
   [ Olaf van der Spek ]

Modified: lighttpd/trunk/src/buffer.h
===================================================================
--- lighttpd/trunk/src/buffer.h	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/buffer.h	2010-08-23 21:41:54 UTC (rev 485)
@@ -9,6 +9,7 @@
 
 #include <stdlib.h>
 #include <sys/types.h>
+#include <stdio.h>
 
 typedef struct {
 	char *ptr;

Modified: lighttpd/trunk/src/connections.c
===================================================================
--- lighttpd/trunk/src/connections.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/connections.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -1792,7 +1792,7 @@
 	case CON_STATE_READ_POST:
 	case CON_STATE_READ:
 	case CON_STATE_CLOSE:
-		fdevent_event_add(srv->ev, &(con->fde_ndx), con->fd, FDEVENT_IN);
+		fdevent_event_set(srv->ev, &(con->fde_ndx), con->fd, FDEVENT_IN);
 		break;
 	case CON_STATE_WRITE:
 		/* request write-fdevent only if we really need it
@@ -1802,7 +1802,7 @@
 		if (!chunkqueue_is_empty(con->write_queue) &&
 		    (con->is_writable == 0) &&
 		    (con->traffic_limit_reached == 0)) {
-			fdevent_event_add(srv->ev, &(con->fde_ndx), con->fd, FDEVENT_OUT);
+			fdevent_event_set(srv->ev, &(con->fde_ndx), con->fd, FDEVENT_OUT);
 		} else {
 			fdevent_event_del(srv->ev, &(con->fde_ndx), con->fd);
 		}

Modified: lighttpd/trunk/src/fdevent.c
===================================================================
--- lighttpd/trunk/src/fdevent.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/fdevent.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <stdio.h>
 #include <fcntl.h>
+#include <assert.h>
 
 
 fdevents *fdevent_init(server *srv, size_t maxfds, fdevent_handler_t type) {
@@ -112,6 +113,7 @@
 	fdn->fd      = fd;
 	fdn->ctx     = ctx;
 	fdn->handler_ctx = NULL;
+	fdn->events  = 0;
 
 	ev->fdarray[fd] = fdn;
 
@@ -120,9 +122,12 @@
 
 int fdevent_unregister(fdevents *ev, int fd) {
 	fdnode *fdn;
-        if (!ev) return 0;
+
+	if (!ev) return 0;
 	fdn = ev->fdarray[fd];
 
+	assert(fdn->events == 0);
+
 	fdnode_free(fdn);
 
 	ev->fdarray[fd] = NULL;
@@ -133,17 +138,21 @@
 int fdevent_event_del(fdevents *ev, int *fde_ndx, int fd) {
 	int fde = fde_ndx ? *fde_ndx : -1;
 
+	if (NULL == ev->fdarray[fd]) return 0;
+
 	if (ev->event_del) fde = ev->event_del(ev, fde, fd);
+	ev->fdarray[fd]->events = 0;
 
 	if (fde_ndx) *fde_ndx = fde;
 
 	return 0;
 }
 
-int fdevent_event_add(fdevents *ev, int *fde_ndx, int fd, int events) {
+int fdevent_event_set(fdevents *ev, int *fde_ndx, int fd, int events) {
 	int fde = fde_ndx ? *fde_ndx : -1;
 
-	if (ev->event_add) fde = ev->event_add(ev, fde, fd, events);
+	if (ev->event_set) fde = ev->event_set(ev, fde, fd, events);
+	ev->fdarray[fd]->events = events;
 
 	if (fde_ndx) *fde_ndx = fde;
 

Modified: lighttpd/trunk/src/fdevent.h
===================================================================
--- lighttpd/trunk/src/fdevent.h	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/fdevent.h	2010-08-23 21:41:54 UTC (rev 485)
@@ -91,7 +91,6 @@
 		FDEVENT_HANDLER_LINUX_SYSEPOLL,
 		FDEVENT_HANDLER_SOLARIS_DEVPOLL,
 		FDEVENT_HANDLER_FREEBSD_KQUEUE,
-		FDEVENT_HANDLER_SOLARIS_PORT,
 		FDEVENT_HANDLER_LIBEV
 } fdevent_handler_t;
 
@@ -101,6 +100,7 @@
 	void *ctx;
 	void *handler_ctx;
 	int fd;
+	int events;
 } fdnode;
 
 /**
@@ -166,7 +166,7 @@
 	int (*reset)(struct fdevents *ev);
 	void (*free)(struct fdevents *ev);
 
-	int (*event_add)(struct fdevents *ev, int fde_ndx, int fd, int events);
+	int (*event_set)(struct fdevents *ev, int fde_ndx, int fd, int events);
 	int (*event_del)(struct fdevents *ev, int fde_ndx, int fd);
 	int (*event_get_revent)(struct fdevents *ev, size_t ndx);
 	int (*event_get_fd)(struct fdevents *ev, size_t ndx);
@@ -182,7 +182,7 @@
 int fdevent_reset(fdevents *ev); /* "init" after fork() */
 void fdevent_free(fdevents *ev);
 
-int fdevent_event_add(fdevents *ev, int *fde_ndx, int fd, int events);
+int fdevent_event_set(fdevents *ev, int *fde_ndx, int fd, int events); /* events can be FDEVENT_IN, FDEVENT_OUT or FDEVENT_IN | FDEVENT_OUT */
 int fdevent_event_del(fdevents *ev, int *fde_ndx, int fd);
 int fdevent_event_get_revent(fdevents *ev, size_t ndx);
 int fdevent_event_get_fd(fdevents *ev, size_t ndx);

Modified: lighttpd/trunk/src/fdevent_freebsd_kqueue.c
===================================================================
--- lighttpd/trunk/src/fdevent_freebsd_kqueue.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/fdevent_freebsd_kqueue.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -22,20 +22,31 @@
 }
 
 static int fdevent_freebsd_kqueue_event_del(fdevents *ev, int fde_ndx, int fd) {
-	int ret;
+	int ret, n = 0;
 	struct kevent kev[2];
 	struct timespec ts;
+	int oevents;
 
 	if (fde_ndx < 0) return -1;
 
-	EV_SET(&kev[0], fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
-	EV_SET(&kev[1], fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
+	oevents = ev->fdarray[fd]->events;
 
+	if (oevents & FDEVENT_IN)  {
+		EV_SET(&kev[n], fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
+		n++;
+	}
+	if (oevents & FDEVENT_OUT)  {
+		EV_SET(&kev[n], fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
+		n++;
+	}
+
+	if (0 == n) return -1;
+
 	ts.tv_sec  = 0;
 	ts.tv_nsec = 0;
 
 	ret = kevent(ev->kq_fd,
-		&kev, 2,
+		&kev, n,
 		NULL, 0,
 		&ts);
 
@@ -49,28 +60,46 @@
 	return -1;
 }
 
-static int fdevent_freebsd_kqueue_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
-	int filter, ret;
-	struct kevent kev;
+static int fdevent_freebsd_kqueue_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
+	int ret, n = 0;
+	struct kevent kev[2];
 	struct timespec ts;
+	int oevents = ev->fdarray[fd]->events;
+	int addevents = events & ~oevents;
+	int delevents = ~events & oevents;
 
 	UNUSED(fde_ndx);
 
-	filter = (events & FDEVENT_IN) ? EVFILT_READ : EVFILT_WRITE;
+	if (events == oevents) return fd;
 
-	EV_SET(&kev, fd, filter, EV_ADD|EV_CLEAR, 0, 0, NULL);
+	if (addevents & FDEVENT_IN)  {
+		EV_SET(&kev[n], fd, EVFILT_READ, EV_ADD|EV_CLEAR, 0, 0, NULL);
+		n++;
+	} else if (delevents & FDEVENT_IN) {
+		EV_SET(&kev[n], fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
+		n++;
+	}
+	if (addevents & FDEVENT_OUT)  {
+		EV_SET(&kev[n], fd, EVFILT_WRITE, EV_ADD|EV_CLEAR, 0, 0, NULL);
+		n++;
+	} else if (delevents & FDEVENT_OUT) {
+		EV_SET(&kev[n], fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
+		n++;
+	}
 
+	if (0 == n) return fd;
+
 	ts.tv_sec  = 0;
 	ts.tv_nsec = 0;
 
 	ret = kevent(ev->kq_fd,
-		&kev, 1,
+		kev, n,
 		NULL, 0,
 		&ts);
 
 	if (ret == -1) {
 		log_error_write(ev->srv, __FILE__, __LINE__, "SS",
-			"kqueue event add failed: ", strerror(errno));
+			"kqueue event set failed: ", strerror(errno));
 
 		return -1;
 	}
@@ -161,7 +190,7 @@
 	SET(reset);
 
 	SET(event_del);
-	SET(event_add);
+	SET(event_set);
 
 	SET(event_next_fdndx);
 	SET(event_get_fd);

Modified: lighttpd/trunk/src/fdevent_libev.c
===================================================================
--- lighttpd/trunk/src/fdevent_libev.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/fdevent_libev.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -53,7 +53,7 @@
 	return -1;
 }
 
-static int fdevent_libev_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
+static int fdevent_libev_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
 	fdnode *fdn = ev->fdarray[fd];
 	ev_io *watcher = fdn->handler_ctx;
 	int ev_events = 0;
@@ -70,9 +70,9 @@
 		watcher->data = ev;
 		ev_io_start(ev->libev_loop, watcher);
 	} else {
-		if ((watcher->events & ev_events) != ev_events) {
+		if ((watcher->events & (EV_READ | EV_WRITE)) != ev_events) {
 			ev_io_stop(ev->libev_loop, watcher);
-			ev_io_set(watcher, watcher->fd, watcher->events | ev_events);
+			ev_io_set(watcher, watcher->fd, ev_events);
 			ev_io_start(ev->libev_loop, watcher);
 		}
 	}
@@ -140,7 +140,7 @@
 	SET(reset);
 
 	SET(event_del);
-	SET(event_add);
+	SET(event_set);
 
 	SET(event_next_fdndx);
 	SET(event_get_fd);

Modified: lighttpd/trunk/src/fdevent_linux_sysepoll.c
===================================================================
--- lighttpd/trunk/src/fdevent_linux_sysepoll.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/fdevent_linux_sysepoll.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -41,7 +41,7 @@
 	return -1;
 }
 
-static int fdevent_linux_sysepoll_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
+static int fdevent_linux_sysepoll_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
 	struct epoll_event ep;
 	int add = 0;
 
@@ -124,7 +124,7 @@
 	SET(poll);
 
 	SET(event_del);
-	SET(event_add);
+	SET(event_set);
 
 	SET(event_next_fdndx);
 	SET(event_get_fd);

Modified: lighttpd/trunk/src/fdevent_poll.c
===================================================================
--- lighttpd/trunk/src/fdevent_poll.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/fdevent_poll.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -66,7 +66,7 @@
 }
 #endif
 
-static int fdevent_poll_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
+static int fdevent_poll_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
 	int pevents = 0;
 	if (events & FDEVENT_IN)  pevents |= POLLIN;
 	if (events & FDEVENT_OUT) pevents |= POLLOUT;
@@ -80,7 +80,7 @@
 			return fde_ndx;
 		}
 		log_error_write(ev->srv, __FILE__, __LINE__, "SdD",
-			"add: ", fde_ndx, ev->pollfds[fde_ndx].fd);
+			"set: ", fde_ndx, ev->pollfds[fde_ndx].fd);
 		SEGFAULT();
 	}
 
@@ -170,7 +170,7 @@
 	SET(poll);
 
 	SET(event_del);
-	SET(event_add);
+	SET(event_set);
 
 	SET(event_next_fdndx);
 	SET(event_get_fd);

Modified: lighttpd/trunk/src/fdevent_select.c
===================================================================
--- lighttpd/trunk/src/fdevent_select.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/fdevent_select.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -34,7 +34,7 @@
 	return -1;
 }
 
-static int fdevent_select_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
+static int fdevent_select_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
 	UNUSED(fde_ndx);
 
 	/* we should be protected by max-fds, but you never know */
@@ -42,11 +42,13 @@
 
 	if (events & FDEVENT_IN) {
 		FD_SET(fd, &(ev->select_set_read));
-		FD_CLR(fd, &(ev->select_set_write));
+	} else {
+		FD_CLR(fd, &(ev->select_set_read));
 	}
 	if (events & FDEVENT_OUT) {
-		FD_CLR(fd, &(ev->select_set_read));
 		FD_SET(fd, &(ev->select_set_write));
+	} else {
+		FD_CLR(fd, &(ev->select_set_write));
 	}
 	FD_SET(fd, &(ev->select_set_error));
 
@@ -113,7 +115,7 @@
 	SET(poll);
 
 	SET(event_del);
-	SET(event_add);
+	SET(event_set);
 
 	SET(event_next_fdndx);
 	SET(event_get_fd);

Modified: lighttpd/trunk/src/fdevent_solaris_devpoll.c
===================================================================
--- lighttpd/trunk/src/fdevent_solaris_devpoll.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/fdevent_solaris_devpoll.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -40,7 +40,7 @@
 	return -1;
 }
 
-static int fdevent_solaris_devpoll_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
+static int fdevent_solaris_devpoll_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
 	struct pollfd pfd;
 	int add = 0;
 
@@ -56,7 +56,7 @@
 
 	if (-1 == write(ev->devpoll_fd, &pfd, sizeof(pfd))) {
 		log_error_write(ev->srv, __FILE__, __LINE__, "S(D, S)",
-			"(add) write failed: ", fd, strerror(errno));
+			"(set) write failed: ", fd, strerror(errno));
 
 		return -1;
 	}
@@ -139,7 +139,7 @@
 	SET(reset);
 
 	SET(event_del);
-	SET(event_add);
+	SET(event_set);
 
 	SET(event_next_fdndx);
 	SET(event_get_fd);

Modified: lighttpd/trunk/src/mod_cgi.c
===================================================================
--- lighttpd/trunk/src/mod_cgi.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/mod_cgi.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -1157,7 +1157,7 @@
 		con->plugin_ctx[p->id] = hctx;
 
 		fdevent_register(srv->ev, hctx->fd, cgi_handle_fdevent, hctx);
-		fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+		fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
 
 		if (-1 == fdevent_fcntl_set(srv->ev, hctx->fd)) {
 			log_error_write(srv, __FILE__, __LINE__, "ss", "fcntl failed: ", strerror(errno));

Modified: lighttpd/trunk/src/mod_fastcgi.c
===================================================================
--- lighttpd/trunk/src/mod_fastcgi.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/mod_fastcgi.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -2989,7 +2989,7 @@
 		case CONNECTION_DELAYED:
 			/* connection is in progress, wait for an event and call getsockopt() below */
 
-			fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
 
 			fcgi_set_state(srv, hctx, FCGI_STATE_CONNECT_DELAYED);
 			return HANDLER_WAIT_FOR_EVENT;
@@ -3108,10 +3108,10 @@
 		if (hctx->wb->bytes_out == hctx->wb->bytes_in) {
 			/* we don't need the out event anymore */
 			fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
-			fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
 			fcgi_set_state(srv, hctx, FCGI_STATE_READ);
 		} else {
-			fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
 
 			return HANDLER_WAIT_FOR_EVENT;
 		}
@@ -3726,12 +3726,12 @@
 	if (hctx->fd != -1) {
 		switch (hctx->state) {
 		case FCGI_STATE_READ:
-			fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
 
 			break;
 		case FCGI_STATE_CONNECT_DELAYED:
 		case FCGI_STATE_WRITE:
-			fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
 
 			break;
 		case FCGI_STATE_INIT:

Modified: lighttpd/trunk/src/mod_proxy.c
===================================================================
--- lighttpd/trunk/src/mod_proxy.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/mod_proxy.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -798,7 +798,7 @@
 
 				/* connection is in progress, wait for an event and call getsockopt() below */
 
-				fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+				fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
 
 				return HANDLER_WAIT_FOR_EVENT;
 			case -1:
@@ -863,9 +863,9 @@
 			proxy_set_state(srv, hctx, PROXY_STATE_READ);
 
 			fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
-			fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
 		} else {
-			fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
 
 			return HANDLER_WAIT_FOR_EVENT;
 		}

Modified: lighttpd/trunk/src/mod_scgi.c
===================================================================
--- lighttpd/trunk/src/mod_scgi.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/mod_scgi.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -2230,7 +2230,7 @@
 
 				/* connection is in progress, wait for an event and call getsockopt() below */
 
-				fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+				fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
 
 				return HANDLER_WAIT_FOR_EVENT;
 			case -1:
@@ -2343,10 +2343,10 @@
 		if (hctx->wb->bytes_out == hctx->wb->bytes_in) {
 			/* we don't need the out event anymore */
 			fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
-			fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
 			scgi_set_state(srv, hctx, FCGI_STATE_READ);
 		} else {
-			fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
 
 			return HANDLER_WAIT_FOR_EVENT;
 		}
@@ -2891,12 +2891,12 @@
 	if (hctx->fd != -1) {
 		switch (hctx->state) {
 		case FCGI_STATE_READ:
-			fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
 
 			break;
 		case FCGI_STATE_CONNECT:
 		case FCGI_STATE_WRITE:
-			fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
 
 			break;
 		case FCGI_STATE_INIT:

Modified: lighttpd/trunk/src/network.c
===================================================================
--- lighttpd/trunk/src/network.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/network.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -724,7 +724,7 @@
 		server_socket *srv_socket = srv->srv_sockets.ptr[i];
 
 		fdevent_register(srv->ev, srv_socket->fd, network_server_handle_fdevent, srv_socket);
-		fdevent_event_add(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd, FDEVENT_IN);
+		fdevent_event_set(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd, FDEVENT_IN);
 	}
 	return 0;
 }

Modified: lighttpd/trunk/src/server.c
===================================================================
--- lighttpd/trunk/src/server.c	2010-08-23 21:40:46 UTC (rev 484)
+++ lighttpd/trunk/src/server.c	2010-08-23 21:41:54 UTC (rev 485)
@@ -1147,7 +1147,7 @@
 
 		srv->stat_cache->fam_fcce_ndx = -1;
 		fdevent_register(srv->ev, FAMCONNECTION_GETFD(srv->stat_cache->fam), stat_cache_handle_fdevent, NULL);
-		fdevent_event_add(srv->ev, &(srv->stat_cache->fam_fcce_ndx), FAMCONNECTION_GETFD(srv->stat_cache->fam), FDEVENT_IN);
+		fdevent_event_set(srv->ev, &(srv->stat_cache->fam_fcce_ndx), FAMCONNECTION_GETFD(srv->stat_cache->fam), FDEVENT_IN);
 	}
 #endif
 
@@ -1346,7 +1346,7 @@
 			    (0 == graceful_shutdown)) {
 				for (i = 0; i < srv->srv_sockets.used; i++) {
 					server_socket *srv_socket = srv->srv_sockets.ptr[i];
-					fdevent_event_add(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd, FDEVENT_IN);
+					fdevent_event_set(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd, FDEVENT_IN);
 				}
 
 				log_error_write(srv, __FILE__, __LINE__, "s", "[note] sockets enabled again");




More information about the pkg-lighttpd-maintainers mailing list