summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf van der Spek <olafvdspek@gmail.com>2010-08-23 21:41:54 +0000
committerOlaf van der Spek <olafvdspek@gmail.com>2010-08-23 21:41:54 +0000
commita85840baef48307ba44719ae44bbb0ca801c30a2 (patch)
treefdfdb1aefa733b99259eae4618de831940241d32
parentb0a9856092499507b786855095a89975c1f9ce35 (diff)
downloadlighttpd-a85840baef48307ba44719ae44bbb0ca801c30a2.tar.gz
Upstream 1.4.28
-rw-r--r--NEWS6
-rw-r--r--SConstruct2
-rwxr-xr-xconfigure20
-rw-r--r--configure.ac2
-rw-r--r--debian/changelog6
-rw-r--r--src/buffer.h1
-rw-r--r--src/connections.c4
-rw-r--r--src/fdevent.c15
-rw-r--r--src/fdevent.h6
-rw-r--r--src/fdevent_freebsd_kqueue.c53
-rw-r--r--src/fdevent_libev.c8
-rw-r--r--src/fdevent_linux_sysepoll.c4
-rw-r--r--src/fdevent_poll.c6
-rw-r--r--src/fdevent_select.c10
-rw-r--r--src/fdevent_solaris_devpoll.c6
-rw-r--r--src/mod_cgi.c2
-rw-r--r--src/mod_fastcgi.c10
-rw-r--r--src/mod_proxy.c6
-rw-r--r--src/mod_scgi.c10
-rw-r--r--src/network.c2
-rw-r--r--src/server.c4
21 files changed, 117 insertions, 66 deletions
diff --git a/NEWS b/NEWS
index 6df6e03..f2cd39c 100644
--- a/NEWS
+++ b/NEWS
@@ -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)
diff --git a/SConstruct b/SConstruct
index c5d7838..0513f53 100644
--- a/SConstruct
+++ b/SConstruct
@@ -5,7 +5,7 @@ import string
from stat import *
package = 'lighttpd'
-version = '1.4.27'
+version = '1.4.28'
def checkCHeaders(autoconf, hdrs):
p = re.compile('[^A-Z0-9]')
diff --git a/configure b/configure
index 75f408b..3320daa 100755
--- a/configure
+++ b/configure
@@ -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@lighttpd.net>.
#
@@ -701,8 +701,8 @@ MAKEFLAGS=
# 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@lighttpd.net'
PACKAGE_URL=''
@@ -1493,7 +1493,7 @@ if test "$ac_init_help" = "long"; then
# 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 @@ fi
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 @@ fi
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 @@ cat >config.log <<_ACEOF
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 @@ fi
# Define the identity of the package.
PACKAGE='lighttpd'
- VERSION='1.4.27'
+ VERSION='1.4.28'
cat >>confdefs.h <<_ACEOF
@@ -15820,7 +15820,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# 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 @@ _ACEOF
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\\"
diff --git a/configure.ac b/configure.ac
index 8f62790..6ef0df4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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@lighttpd.net])
+AC_INIT([lighttpd], [1.4.28], [contact@lighttpd.net])
AC_CONFIG_SRCDIR([src/server.c])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
diff --git a/debian/changelog b/debian/changelog
index 3e2966b..1eb8ddd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+lighttpd (1.4.28-1) UNRELEASED; urgency=low
+
+ * New upstream release
+
+ -- Olaf van der Spek <olaf@router> Mon, 23 Aug 2010 23:41:04 +0200
+
lighttpd (1.4.27-1) unstable; urgency=low
[ Olaf van der Spek ]
diff --git a/src/buffer.h b/src/buffer.h
index 67a47ab..bda0424 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <sys/types.h>
+#include <stdio.h>
typedef struct {
char *ptr;
diff --git a/src/connections.c b/src/connections.c
index 2a0a3e1..95c1cda 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -1792,7 +1792,7 @@ int connection_state_machine(server *srv, connection *con) {
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 @@ int connection_state_machine(server *srv, connection *con) {
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);
}
diff --git a/src/fdevent.c b/src/fdevent.c
index e94bfb5..5f24b16 100644
--- a/src/fdevent.c
+++ b/src/fdevent.c
@@ -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 @@ int fdevent_register(fdevents *ev, int fd, fdevent_handler handler, void *ctx) {
fdn->fd = fd;
fdn->ctx = ctx;
fdn->handler_ctx = NULL;
+ fdn->events = 0;
ev->fdarray[fd] = fdn;
@@ -120,9 +122,12 @@ int fdevent_register(fdevents *ev, int fd, fdevent_handler handler, void *ctx) {
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_unregister(fdevents *ev, int fd) {
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;
diff --git a/src/fdevent.h b/src/fdevent.h
index 0b4e202..5f813d6 100644
--- a/src/fdevent.h
+++ b/src/fdevent.h
@@ -91,7 +91,6 @@ typedef enum { FDEVENT_HANDLER_UNSET,
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 @@ typedef struct _fdnode {
void *ctx;
void *handler_ctx;
int fd;
+ int events;
} fdnode;
/**
@@ -166,7 +166,7 @@ typedef struct fdevents {
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 @@ fdevents *fdevent_init(struct server *srv, size_t maxfds, fdevent_handler_t type
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);
diff --git a/src/fdevent_freebsd_kqueue.c b/src/fdevent_freebsd_kqueue.c
index b4e862c..0f53a2a 100644
--- a/src/fdevent_freebsd_kqueue.c
+++ b/src/fdevent_freebsd_kqueue.c
@@ -22,20 +22,31 @@ static void fdevent_freebsd_kqueue_free(fdevents *ev) {
}
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 @@ static int fdevent_freebsd_kqueue_event_del(fdevents *ev, int fde_ndx, int fd) {
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;
+
+ 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++;
+ }
- EV_SET(&kev, fd, filter, EV_ADD|EV_CLEAR, 0, 0, NULL);
+ 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 @@ int fdevent_freebsd_kqueue_init(fdevents *ev) {
SET(reset);
SET(event_del);
- SET(event_add);
+ SET(event_set);
SET(event_next_fdndx);
SET(event_get_fd);
diff --git a/src/fdevent_libev.c b/src/fdevent_libev.c
index 5f7242c..543127a 100644
--- a/src/fdevent_libev.c
+++ b/src/fdevent_libev.c
@@ -53,7 +53,7 @@ static int fdevent_libev_event_del(fdevents *ev, int fde_ndx, int fd) {
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 @@ static int fdevent_libev_event_add(fdevents *ev, int fde_ndx, int fd, int events
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 @@ int fdevent_libev_init(fdevents *ev) {
SET(reset);
SET(event_del);
- SET(event_add);
+ SET(event_set);
SET(event_next_fdndx);
SET(event_get_fd);
diff --git a/src/fdevent_linux_sysepoll.c b/src/fdevent_linux_sysepoll.c
index 891ce5e..b311f45 100644
--- a/src/fdevent_linux_sysepoll.c
+++ b/src/fdevent_linux_sysepoll.c
@@ -41,7 +41,7 @@ static int fdevent_linux_sysepoll_event_del(fdevents *ev, int fde_ndx, int fd) {
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 @@ int fdevent_linux_sysepoll_init(fdevents *ev) {
SET(poll);
SET(event_del);
- SET(event_add);
+ SET(event_set);
SET(event_next_fdndx);
SET(event_get_fd);
diff --git a/src/fdevent_poll.c b/src/fdevent_poll.c
index f11c878..6d102e6 100644
--- a/src/fdevent_poll.c
+++ b/src/fdevent_poll.c
@@ -66,7 +66,7 @@ static int fdevent_poll_event_compress(fdevents *ev) {
}
#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 @@ static int fdevent_poll_event_add(fdevents *ev, int fde_ndx, int fd, int events)
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 @@ int fdevent_poll_init(fdevents *ev) {
SET(poll);
SET(event_del);
- SET(event_add);
+ SET(event_set);
SET(event_next_fdndx);
SET(event_get_fd);
diff --git a/src/fdevent_select.c b/src/fdevent_select.c
index 322c31b..2e23dce 100644
--- a/src/fdevent_select.c
+++ b/src/fdevent_select.c
@@ -34,7 +34,7 @@ static int fdevent_select_event_del(fdevents *ev, int fde_ndx, int fd) {
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 @@ static int fdevent_select_event_add(fdevents *ev, int fde_ndx, int fd, int event
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 @@ int fdevent_select_init(fdevents *ev) {
SET(poll);
SET(event_del);
- SET(event_add);
+ SET(event_set);
SET(event_next_fdndx);
SET(event_get_fd);
diff --git a/src/fdevent_solaris_devpoll.c b/src/fdevent_solaris_devpoll.c
index da08eb4..cfbc510 100644
--- a/src/fdevent_solaris_devpoll.c
+++ b/src/fdevent_solaris_devpoll.c
@@ -40,7 +40,7 @@ static int fdevent_solaris_devpoll_event_del(fdevents *ev, int fde_ndx, int fd)
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 @@ static int fdevent_solaris_devpoll_event_add(fdevents *ev, int fde_ndx, int fd,
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 @@ int fdevent_solaris_devpoll_init(fdevents *ev) {
SET(reset);
SET(event_del);
- SET(event_add);
+ SET(event_set);
SET(event_next_fdndx);
SET(event_get_fd);
diff --git a/src/mod_cgi.c b/src/mod_cgi.c
index 94f1b7f..1608f02 100644
--- a/src/mod_cgi.c
+++ b/src/mod_cgi.c
@@ -1157,7 +1157,7 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
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));
diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c
index 6814550..ae39d89 100644
--- a/src/mod_fastcgi.c
+++ b/src/mod_fastcgi.c
@@ -2989,7 +2989,7 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
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 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
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 @@ JOBLIST_FUNC(mod_fastcgi_handle_joblist) {
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:
diff --git a/src/mod_proxy.c b/src/mod_proxy.c
index e031f52..b54d243 100644
--- a/src/mod_proxy.c
+++ b/src/mod_proxy.c
@@ -798,7 +798,7 @@ static handler_t proxy_write_request(server *srv, handler_ctx *hctx) {
/* 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 @@ static handler_t proxy_write_request(server *srv, handler_ctx *hctx) {
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;
}
diff --git a/src/mod_scgi.c b/src/mod_scgi.c
index d13b03d..0455fbf 100644
--- a/src/mod_scgi.c
+++ b/src/mod_scgi.c
@@ -2230,7 +2230,7 @@ static handler_t scgi_write_request(server *srv, handler_ctx *hctx) {
/* 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 @@ static handler_t scgi_write_request(server *srv, handler_ctx *hctx) {
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 @@ JOBLIST_FUNC(mod_scgi_handle_joblist) {
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:
diff --git a/src/network.c b/src/network.c
index 43e0f33..a98b4b8 100644
--- a/src/network.c
+++ b/src/network.c
@@ -724,7 +724,7 @@ int network_register_fdevents(server *srv) {
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;
}
diff --git a/src/server.c b/src/server.c
index 79e78b3..0b92239 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1147,7 +1147,7 @@ int main (int argc, char **argv) {
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 @@ int main (int argc, char **argv) {
(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");