Browse Source

cleanup fdevent code, removed linux-rtsig handler, replaced some fprintf calls

* use log functions
 * convert flags
 * fix handler callback prototype

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2752 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.27
Stefan Bühler 11 years ago
parent
commit
38f2d1ddd7
  1. 1
      NEWS
  2. 2
      SConstruct
  3. 2
      configure.ac
  4. 2
      src/CMakeLists.txt
  5. 2
      src/Makefile.am
  6. 2
      src/SConscript
  7. 2
      src/array.c
  8. 3
      src/configfile.c
  9. 3
      src/connections.c
  10. 38
      src/fdevent.c
  11. 24
      src/fdevent.h
  12. 61
      src/fdevent_freebsd_kqueue.c
  13. 258
      src/fdevent_linux_rtsig.c
  14. 22
      src/fdevent_linux_sysepoll.c
  15. 35
      src/fdevent_poll.c
  16. 9
      src/fdevent_select.c
  17. 49
      src/fdevent_solaris_devpoll.c
  18. 5
      src/http_auth.c
  19. 6
      src/keyvalue.c
  20. 4
      src/keyvalue.h
  21. 3
      src/mod_cgi.c
  22. 2
      src/mod_dirlisting.c
  23. 15
      src/mod_extforward.c
  24. 19
      src/mod_fastcgi.c
  25. 5
      src/mod_proxy.c
  26. 2
      src/mod_redirect.c
  27. 19
      src/mod_scgi.c
  28. 3
      src/network.c
  29. 4
      src/server.c
  30. 6
      src/stat_cache.c
  31. 2
      src/stat_cache.h

1
NEWS

@ -27,6 +27,7 @@ NEWS
* openssl: silence annoying error messages for errno==0 (fixes #2213)
* array.c: improve array_get_unused_element to check data type; fix mem leak if unused_element didn't find a matching entry (fixes #2145)
* add check to stop loading plugins twice
* cleanup fdevent code, removed linux-rtsig handler, replaced some fprintf calls
- 1.4.26 - 2010-02-07
* Fix request parser to handle packets with splitted \r\n\r\n (fixes #2105)

2
SConstruct

@ -157,7 +157,7 @@ if 1:
checkFuncs(autoconf, Split('fork stat lstat strftime dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
strdup strerror strstr strtol sendfile getopt socket \
gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \
gethostbyname poll epoll_ctl getrlimit chroot \
getuid select signal pathconf madvise prctl\
writev sigaction sendfile64 send_file kqueue port_create localtime_r posix_fadvise issetugid inet_pton'))

2
configure.ac

@ -469,7 +469,7 @@ esac
AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
strdup strerror strstr strtol sendfile getopt socket lstat \
gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \
gethostbyname poll epoll_ctl getrlimit chroot \
getuid select signal pathconf madvise posix_fadvise posix_madvise \
writev sigaction sendfile64 send_file kqueue port_create localtime_r gmtime_r])

2
src/CMakeLists.txt

@ -409,7 +409,7 @@ SET(COMMON_SRC
stat_cache.c plugin.c joblist.c etag.c array.c
data_string.c data_count.c data_array.c
data_integer.c md5.c data_fastcgi.c
fdevent_select.c fdevent_linux_rtsig.c
fdevent_select.c
fdevent_poll.c fdevent_linux_sysepoll.c
fdevent_solaris_devpoll.c fdevent_freebsd_kqueue.c
data_config.c bitset.c

2
src/Makefile.am

@ -62,7 +62,7 @@ common_src=buffer.c log.c \
stat_cache.c plugin.c joblist.c etag.c array.c \
data_string.c data_count.c data_array.c \
data_integer.c md5.c data_fastcgi.c \
fdevent_select.c fdevent_linux_rtsig.c \
fdevent_select.c \
fdevent_poll.c fdevent_linux_sysepoll.c \
fdevent_solaris_devpoll.c fdevent_freebsd_kqueue.c \
data_config.c bitset.c \

2
src/SConscript

@ -10,7 +10,7 @@ common_src = Split("buffer.c log.c \
stat_cache.c plugin.c joblist.c etag.c array.c \
data_string.c data_count.c data_array.c \
data_integer.c md5.c data_fastcgi.c \
fdevent_select.c fdevent_linux_rtsig.c \
fdevent_select.c \
fdevent_poll.c fdevent_linux_sysepoll.c \
fdevent_solaris_devpoll.c fdevent_freebsd_kqueue.c \
data_config.c bitset.c \

2
src/array.c

@ -195,7 +195,7 @@ int array_insert_unique(array *a, data_unset *str) {
if (a->data[ndx]->type == str->type) {
str->insert_dup(a->data[ndx], str);
} else {
fprintf(stderr, "a\n");
SEGFAULT();
}
return 0;
}

3
src/configfile.c

@ -1184,9 +1184,6 @@ int config_set_defaults(server *srv) {
#ifdef USE_SELECT
{ FDEVENT_HANDLER_SELECT, "select" },
#endif
#ifdef USE_LINUX_SIGIO
{ FDEVENT_HANDLER_LINUX_RTSIG, "linux-rtsig" },
#endif
#ifdef USE_SOLARIS_DEVPOLL
{ FDEVENT_HANDLER_SOLARIS_DEVPOLL,"solaris-devpoll" },
#endif

3
src/connections.c

@ -1177,8 +1177,7 @@ found_header_end:
return 0;
}
static handler_t connection_handle_fdevent(void *s, void *context, int revents) {
server *srv = (server *)s;
static handler_t connection_handle_fdevent(server *srv, void *context, int revents) {
connection *con = context;
joblist_append(srv, con);

38
src/fdevent.c

@ -1,5 +1,5 @@
#include "fdevent.h"
#include "buffer.h"
#include "base.h"
#include "log.h"
#include <sys/types.h>
@ -11,60 +11,54 @@
#include <fcntl.h>
fdevents *fdevent_init(size_t maxfds, fdevent_handler_t type) {
fdevents *fdevent_init(server *srv, size_t maxfds, fdevent_handler_t type) {
fdevents *ev;
ev = calloc(1, sizeof(*ev));
ev->srv = srv;
ev->fdarray = calloc(maxfds, sizeof(*ev->fdarray));
ev->maxfds = maxfds;
switch(type) {
case FDEVENT_HANDLER_POLL:
if (0 != fdevent_poll_init(ev)) {
fprintf(stderr, "%s.%d: event-handler poll failed\n",
__FILE__, __LINE__);
log_error_write(ev->srv, __FILE__, __LINE__, "S",
"event-handler poll failed");
return NULL;
}
break;
case FDEVENT_HANDLER_SELECT:
if (0 != fdevent_select_init(ev)) {
fprintf(stderr, "%s.%d: event-handler select failed\n",
__FILE__, __LINE__);
return NULL;
}
break;
case FDEVENT_HANDLER_LINUX_RTSIG:
if (0 != fdevent_linux_rtsig_init(ev)) {
fprintf(stderr, "%s.%d: event-handler linux-rtsig failed, try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__);
log_error_write(ev->srv, __FILE__, __LINE__, "S",
"event-handler select failed");
return NULL;
}
break;
case FDEVENT_HANDLER_LINUX_SYSEPOLL:
if (0 != fdevent_linux_sysepoll_init(ev)) {
fprintf(stderr, "%s.%d: event-handler linux-sysepoll failed, try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__);
log_error_write(ev->srv, __FILE__, __LINE__, "S",
"event-handler linux-sysepoll failed, try to set server.event-handler = \"poll\" or \"select\"");
return NULL;
}
break;
case FDEVENT_HANDLER_SOLARIS_DEVPOLL:
if (0 != fdevent_solaris_devpoll_init(ev)) {
fprintf(stderr, "%s.%d: event-handler solaris-devpoll failed, try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__);
log_error_write(ev->srv, __FILE__, __LINE__, "S",
"event-handler solaris-devpoll failed, try to set server.event-handler = \"poll\" or \"select\"");
return NULL;
}
break;
case FDEVENT_HANDLER_FREEBSD_KQUEUE:
if (0 != fdevent_freebsd_kqueue_init(ev)) {
fprintf(stderr, "%s.%d: event-handler freebsd-kqueue failed, try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__);
log_error_write(ev->srv, __FILE__, __LINE__, "S",
"event-handler freebsd-kqueue failed, try to set server.event-handler = \"poll\" or \"select\"");
return NULL;
}
break;
default:
fprintf(stderr, "%s.%d: event-handler is unknown, try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__);
log_error_write(ev->srv, __FILE__, __LINE__, "S",
"event-handler is unknown, try to set server.event-handler = \"poll\" or \"select\"");
return NULL;
}

24
src/fdevent.h

@ -32,10 +32,6 @@
# else
# include <sys/poll.h>
# endif
# if defined HAVE_SIGTIMEDWAIT && defined(__linux__)
# define USE_LINUX_SIGIO
# include <signal.h>
# endif
#endif
#if defined HAVE_SELECT
@ -63,8 +59,12 @@
# include <sys/port.h>
#endif
struct server;
typedef handler_t (*fdevent_handler)(struct server *srv, void *ctx, int revents);
typedef handler_t (*fdevent_handler)(void *srv, void *ctx, int revents);
/* these are the POLL* values from <bits/poll.h> (linux poll)
*/
#define FDEVENT_IN BV(0)
#define FDEVENT_PRI BV(1)
@ -134,18 +134,12 @@ typedef struct {
*
*/
typedef struct fdevents {
struct server *srv;
fdevent_handler_t type;
fdnode **fdarray;
size_t maxfds;
#ifdef USE_LINUX_SIGIO
int in_sigio;
int signum;
sigset_t sigset;
siginfo_t siginfo;
bitset *sigbset;
#endif
#ifdef USE_LINUX_EPOLL
int epoll_fd;
struct epoll_event *epoll_events;
@ -176,7 +170,6 @@ typedef struct fdevents {
#ifdef USE_FREEBSD_KQUEUE
int kq_fd;
struct kevent *kq_results;
bitset *kq_bevents;
#endif
#ifdef USE_SOLARIS_PORT
int port_fd;
@ -196,8 +189,8 @@ typedef struct fdevents {
int (*fcntl_set)(struct fdevents *ev, int fd);
} fdevents;
fdevents *fdevent_init(size_t maxfds, fdevent_handler_t type);
int fdevent_reset(fdevents *ev);
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);
@ -218,7 +211,6 @@ int fdevent_fcntl_set(fdevents *ev, int fd);
int fdevent_select_init(fdevents *ev);
int fdevent_poll_init(fdevents *ev);
int fdevent_linux_rtsig_init(fdevents *ev);
int fdevent_linux_sysepoll_init(fdevents *ev);
int fdevent_solaris_devpoll_init(fdevents *ev);
int fdevent_freebsd_kqueue_init(fdevents *ev);

61
src/fdevent_freebsd_kqueue.c

@ -1,6 +1,6 @@
#include "fdevent.h"
#include "buffer.h"
#include "server.h"
#include "log.h"
#include <sys/types.h>
@ -19,31 +19,29 @@
static void fdevent_freebsd_kqueue_free(fdevents *ev) {
close(ev->kq_fd);
free(ev->kq_results);
bitset_free(ev->kq_bevents);
}
static int fdevent_freebsd_kqueue_event_del(fdevents *ev, int fde_ndx, int fd) {
int filter, ret;
struct kevent kev;
int ret;
struct kevent kev[2];
struct timespec ts;
if (fde_ndx < 0) return -1;
filter = bitset_test_bit(ev->kq_bevents, fd) ? EVFILT_READ : EVFILT_WRITE;
EV_SET(&kev, fd, filter, EV_DELETE, 0, 0, NULL);
EV_SET(&kev[0], fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
EV_SET(&kev[1], fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
ts.tv_sec = 0;
ts.tv_nsec = 0;
ret = kevent(ev->kq_fd,
&kev, 1,
NULL, 0,
&ts);
&kev, 2,
NULL, 0,
&ts);
if (ret == -1) {
fprintf(stderr, "%s.%d: kqueue failed polling: %s\n",
__FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SS",
"kqueue event delete failed: ", strerror(errno));
return -1;
}
@ -66,23 +64,17 @@ static int fdevent_freebsd_kqueue_event_add(fdevents *ev, int fde_ndx, int fd, i
ts.tv_nsec = 0;
ret = kevent(ev->kq_fd,
&kev, 1,
NULL, 0,
&ts);
&kev, 1,
NULL, 0,
&ts);
if (ret == -1) {
fprintf(stderr, "%s.%d: kqueue failed polling: %s\n",
__FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SS",
"kqueue event add failed: ", strerror(errno));
return -1;
}
if (filter == EVFILT_READ) {
bitset_set_bit(ev->kq_bevents, fd);
} else {
bitset_clear_bit(ev->kq_bevents, fd);
}
return fd;
}
@ -94,9 +86,9 @@ static int fdevent_freebsd_kqueue_poll(fdevents *ev, int timeout_ms) {
ts.tv_nsec = (timeout_ms % 1000) * 1000000;
ret = kevent(ev->kq_fd,
NULL, 0,
ev->kq_results, ev->maxfds,
&ts);
NULL, 0,
ev->kq_results, ev->maxfds,
&ts);
if (ret == -1) {
switch(errno) {
@ -104,8 +96,8 @@ static int fdevent_freebsd_kqueue_poll(fdevents *ev, int timeout_ms) {
/* we got interrupted, perhaps just a SIGCHLD of a CGI script */
return 0;
default:
fprintf(stderr, "%s.%d: kqueue failed polling: %s\n",
__FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SS",
"kqueue failed polling: ", strerror(errno));
break;
}
}
@ -149,8 +141,8 @@ static int fdevent_freebsd_kqueue_event_next_fdndx(fdevents *ev, int ndx) {
static int fdevent_freebsd_kqueue_reset(fdevents *ev) {
if (-1 == (ev->kq_fd = kqueue())) {
fprintf(stderr, "%s.%d: kqueue failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
"kqueue failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
return -1;
}
@ -178,13 +170,12 @@ int fdevent_freebsd_kqueue_init(fdevents *ev) {
ev->kq_fd = -1;
ev->kq_results = calloc(ev->maxfds, sizeof(*ev->kq_results));
ev->kq_bevents = bitset_init(ev->maxfds);
/* check that kqueue works */
if (-1 == (ev->kq_fd = kqueue())) {
fprintf(stderr, "%s.%d: kqueue failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
"kqueue failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
return -1;
}
@ -198,8 +189,8 @@ int fdevent_freebsd_kqueue_init(fdevents *ev) {
int fdevent_freebsd_kqueue_init(fdevents *ev) {
UNUSED(ev);
fprintf(stderr, "%s.%d: kqueue not available, try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__);
log_error_write(ev->srv, __FILE__, __LINE__, "S",
"kqueue not available, try to set server.event-handler = \"poll\" or \"select\"");
return -1;
}

258
src/fdevent_linux_rtsig.c

@ -1,258 +0,0 @@
#include "fdevent.h"
#include "buffer.h"
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <limits.h>
#include <fcntl.h>
#ifdef USE_LINUX_SIGIO
static void fdevent_linux_rtsig_free(fdevents *ev) {
free(ev->pollfds);
if (ev->unused.ptr) free(ev->unused.ptr);
bitset_free(ev->sigbset);
}
static int fdevent_linux_rtsig_event_del(fdevents *ev, int fde_ndx, int fd) {
if (fde_ndx < 0) return -1;
if ((size_t)fde_ndx >= ev->used) {
fprintf(stderr, "%s.%d: del! out of range %d %zu\n", __FILE__, __LINE__, fde_ndx, ev->used);
SEGFAULT();
}
if (ev->pollfds[fde_ndx].fd == fd) {
size_t k = fde_ndx;
ev->pollfds[k].fd = -1;
bitset_clear_bit(ev->sigbset, fd);
if (ev->unused.size == 0) {
ev->unused.size = 16;
ev->unused.ptr = malloc(sizeof(*(ev->unused.ptr)) * ev->unused.size);
} else if (ev->unused.size == ev->unused.used) {
ev->unused.size += 16;
ev->unused.ptr = realloc(ev->unused.ptr, sizeof(*(ev->unused.ptr)) * ev->unused.size);
}
ev->unused.ptr[ev->unused.used++] = k;
} else {
fprintf(stderr, "%s.%d: del! %d %d\n", __FILE__, __LINE__, ev->pollfds[fde_ndx].fd, fd);
SEGFAULT();
}
return -1;
}
#if 0
static int fdevent_linux_rtsig_event_compress(fdevents *ev) {
size_t j;
if (ev->used == 0) return 0;
if (ev->unused.used != 0) return 0;
for (j = ev->used - 1; j + 1 > 0; j--) {
if (ev->pollfds[j].fd == -1) ev->used--;
}
return 0;
}
#endif
static int fdevent_linux_rtsig_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
/* known index */
if (fde_ndx != -1) {
if (ev->pollfds[fde_ndx].fd == fd) {
ev->pollfds[fde_ndx].events = events;
return fde_ndx;
}
fprintf(stderr, "%s.%d: add: (%d, %d)\n", __FILE__, __LINE__, fde_ndx, ev->pollfds[fde_ndx].fd);
SEGFAULT();
}
if (ev->unused.used > 0) {
int k = ev->unused.ptr[--ev->unused.used];
ev->pollfds[k].fd = fd;
ev->pollfds[k].events = events;
bitset_set_bit(ev->sigbset, fd);
return k;
} else {
if (ev->size == 0) {
ev->size = 16;
ev->pollfds = malloc(sizeof(*ev->pollfds) * ev->size);
} else if (ev->size == ev->used) {
ev->size += 16;
ev->pollfds = realloc(ev->pollfds, sizeof(*ev->pollfds) * ev->size);
}
ev->pollfds[ev->used].fd = fd;
ev->pollfds[ev->used].events = events;
bitset_set_bit(ev->sigbset, fd);
return ev->used++;
}
}
static int fdevent_linux_rtsig_poll(fdevents *ev, int timeout_ms) {
struct timespec ts;
int r;
#if 0
fdevent_linux_rtsig_event_compress(ev);
#endif
ev->in_sigio = 1;
ts.tv_sec = timeout_ms / 1000;
ts.tv_nsec = (timeout_ms % 1000) * 1000000;
r = sigtimedwait(&(ev->sigset), &(ev->siginfo), &(ts));
if (r == -1) {
if (errno == EAGAIN) return 0;
return r;
} else if (r == SIGIO) {
struct sigaction act;
/* flush the signal queue */
memset(&act, 0, sizeof(act));
act.sa_handler = SIG_IGN;
sigaction(ev->signum, &act, NULL);
/* re-enable the signal queue */
act.sa_handler = SIG_DFL;
sigaction(ev->signum, &act, NULL);
ev->in_sigio = 0;
r = poll(ev->pollfds, ev->used, timeout_ms);
return r;
} else if (r == ev->signum) {
# if 0
fprintf(stderr, "event: %d %02lx\n", ev->siginfo.si_fd, ev->siginfo.si_band);
# endif
return bitset_test_bit(ev->sigbset, ev->siginfo.si_fd);
} else {
/* ? */
return -1;
}
}
static int fdevent_linux_rtsig_event_get_revent(fdevents *ev, size_t ndx) {
if (ev->in_sigio == 1) {
# if 0
if (ev->siginfo.si_band == POLLERR) {
fprintf(stderr, "event: %d %02lx %02x %s\n", ev->siginfo.si_fd, ev->siginfo.si_band, errno, strerror(errno));
}
# endif
if (ndx != 0) {
fprintf(stderr, "+\n");
return 0;
}
return ev->siginfo.si_band & 0x3f;
} else {
if (ndx >= ev->used) {
fprintf(stderr, "%s.%d: event: %zu %zu\n", __FILE__, __LINE__, ndx, ev->used);
return 0;
}
return ev->pollfds[ndx].revents;
}
}
static int fdevent_linux_rtsig_event_get_fd(fdevents *ev, size_t ndx) {
if (ev->in_sigio == 1) {
return ev->siginfo.si_fd;
} else {
return ev->pollfds[ndx].fd;
}
}
static int fdevent_linux_rtsig_fcntl_set(fdevents *ev, int fd) {
static pid_t pid = 0;
if (pid == 0) pid = getpid();
if (-1 == fcntl(fd, F_SETSIG, ev->signum)) return -1;
if (-1 == fcntl(fd, F_SETOWN, (int) pid)) return -1;
return fcntl(fd, F_SETFL, O_ASYNC | O_NONBLOCK | O_RDWR);
}
static int fdevent_linux_rtsig_event_next_fdndx(fdevents *ev, int ndx) {
if (ev->in_sigio == 1) {
if (ndx < 0) return 0;
return -1;
} else {
size_t i;
i = (ndx < 0) ? 0 : ndx + 1;
for (; i < ev->used; i++) {
if (ev->pollfds[i].revents) break;
}
return i;
}
}
int fdevent_linux_rtsig_init(fdevents *ev) {
ev->type = FDEVENT_HANDLER_LINUX_RTSIG;
#define SET(x) \
ev->x = fdevent_linux_rtsig_##x;
SET(free);
SET(poll);
SET(event_del);
SET(event_add);
SET(event_next_fdndx);
SET(fcntl_set);
SET(event_get_fd);
SET(event_get_revent);
ev->signum = SIGRTMIN + 1;
sigemptyset(&(ev->sigset));
sigaddset(&(ev->sigset), ev->signum);
sigaddset(&(ev->sigset), SIGIO);
if (-1 == sigprocmask(SIG_BLOCK, &(ev->sigset), NULL)) {
fprintf(stderr, "%s.%d: sigprocmask failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__, strerror(errno));
return -1;
}
ev->in_sigio = 1;
ev->sigbset = bitset_init(ev->maxfds);
return 0;
}
#else
int fdevent_linux_rtsig_init(fdevents *ev) {
UNUSED(ev);
fprintf(stderr, "%s.%d: linux-rtsig not supported, try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__);
return -1;
}
#endif

22
src/fdevent_linux_sysepoll.c

@ -1,5 +1,6 @@
#include "fdevent.h"
#include "buffer.h"
#include "log.h"
#include <sys/types.h>
@ -28,7 +29,8 @@ static int fdevent_linux_sysepoll_event_del(fdevents *ev, int fde_ndx, int fd) {
ep.data.ptr = NULL;
if (0 != epoll_ctl(ev->epoll_fd, EPOLL_CTL_DEL, fd, &ep)) {
fprintf(stderr, "%s.%d: epoll_ctl failed: %s, dying\n", __FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
"epoll_ctl failed: ", strerror(errno), ", dying");
SEGFAULT();
@ -66,7 +68,8 @@ static int fdevent_linux_sysepoll_event_add(fdevents *ev, int fde_ndx, int fd, i
ep.data.fd = fd;
if (0 != epoll_ctl(ev->epoll_fd, add ? EPOLL_CTL_ADD : EPOLL_CTL_MOD, fd, &ep)) {
fprintf(stderr, "%s.%d: epoll_ctl failed: %s, dying\n", __FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
"epoll_ctl failed: ", strerror(errno), ", dying");
SEGFAULT();
@ -95,7 +98,8 @@ static int fdevent_linux_sysepoll_event_get_revent(fdevents *ev, size_t ndx) {
static int fdevent_linux_sysepoll_event_get_fd(fdevents *ev, size_t ndx) {
# if 0
fprintf(stderr, "%s.%d: %d, %d\n", __FILE__, __LINE__, ndx, ev->epoll_events[ndx].data.fd);
log_error_write(ev->srv, __FILE__, __LINE__, "SD, D",
"fdevent_linux_sysepoll_event_get_fd: ", (int) ndx, ev->epoll_events[ndx].data.fd);
# endif
return ev->epoll_events[ndx].data.fd;
@ -127,15 +131,15 @@ int fdevent_linux_sysepoll_init(fdevents *ev) {
SET(event_get_revent);
if (-1 == (ev->epoll_fd = epoll_create(ev->maxfds))) {
fprintf(stderr, "%s.%d: epoll_create failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
"epoll_create failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
return -1;
}
if (-1 == fcntl(ev->epoll_fd, F_SETFD, FD_CLOEXEC)) {
fprintf(stderr, "%s.%d: epoll_create failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
"fcntl on epoll-fd failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
close(ev->epoll_fd);
@ -151,8 +155,8 @@ int fdevent_linux_sysepoll_init(fdevents *ev) {
int fdevent_linux_sysepoll_init(fdevents *ev) {
UNUSED(ev);
fprintf(stderr, "%s.%d: linux-sysepoll not supported, try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__);
log_error_write(ev->srv, __FILE__, __LINE__, "S",
"linux-sysepoll not supported, try to set server.event-handler = \"poll\" or \"select\"");
return -1;
}

35
src/fdevent_poll.c

@ -1,5 +1,6 @@
#include "fdevent.h"
#include "buffer.h"
#include "log.h"
#include <sys/types.h>
@ -21,7 +22,8 @@ static int fdevent_poll_event_del(fdevents *ev, int fde_ndx, int fd) {
if (fde_ndx < 0) return -1;
if ((size_t)fde_ndx >= ev->used) {
fprintf(stderr, "%s.%d: del! out of range %d %zd\n", __FILE__, __LINE__, fde_ndx, ev->used);
log_error_write(ev->srv, __FILE__, __LINE__, "SdD",
"del! out of range ", fde_ndx, (int) ev->used);
SEGFAULT();
}
@ -42,6 +44,9 @@ static int fdevent_poll_event_del(fdevents *ev, int fde_ndx, int fd) {
ev->unused.ptr[ev->unused.used++] = k;
} else {
log_error_write(ev->srv, __FILE__, __LINE__, "SdD",
"del! ", ev->pollfds[fde_ndx].fd, fd);
SEGFAULT();
}
@ -62,15 +67,20 @@ static int fdevent_poll_event_compress(fdevents *ev) {
#endif
static int fdevent_poll_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
int pevents = 0;
if (events & FDEVENT_IN) pevents |= POLLIN;
if (events & FDEVENT_OUT) pevents |= POLLOUT;
/* known index */
if (fde_ndx != -1) {
if (ev->pollfds[fde_ndx].fd == fd) {
ev->pollfds[fde_ndx].events = events;
ev->pollfds[fde_ndx].events = pevents;
return fde_ndx;
}
fprintf(stderr, "%s.%d: add: (%d, %d)\n", __FILE__, __LINE__, fde_ndx, ev->pollfds[fde_ndx].fd);
log_error_write(ev->srv, __FILE__, __LINE__, "SdD",
"add: ", fde_ndx, ev->pollfds[fde_ndx].fd);
SEGFAULT();
}
@ -78,7 +88,7 @@ static int fdevent_poll_event_add(fdevents *ev, int fde_ndx, int fd, int events)
int k = ev->unused.ptr[--ev->unused.used];
ev->pollfds[k].fd = fd;
ev->pollfds[k].events = events;
ev->pollfds[k].events = pevents;
return k;
} else {
@ -91,7 +101,7 @@ static int fdevent_poll_event_add(fdevents *ev, int fde_ndx, int fd, int events)
}
ev->pollfds[ev->used].fd = fd;
ev->pollfds[ev->used].events = events;
ev->pollfds[ev->used].events = pevents;
return ev->used++;
}
@ -106,8 +116,10 @@ static int fdevent_poll_poll(fdevents *ev, int timeout_ms) {
static int fdevent_poll_event_get_revent(fdevents *ev, size_t ndx) {
int r, poll_r;
if (ndx >= ev->used) {
fprintf(stderr, "%s.%d: dying because: event: %zd >= %zd\n", __FILE__, __LINE__, ndx, ev->used);
log_error_write(ev->srv, __FILE__, __LINE__, "sii",
"dying because: event: ", (int) ndx, (int) ev->used);
SEGFAULT();
@ -122,7 +134,7 @@ static int fdevent_poll_event_get_revent(fdevents *ev, size_t ndx) {
r = 0;
poll_r = ev->pollfds[ndx].revents;
/* map POLL* to FDEVEN_* */
/* map POLL* to FDEVEN_*; they are probably the same, but still. */
if (poll_r & POLLIN) r |= FDEVENT_IN;
if (poll_r & POLLOUT) r |= FDEVENT_OUT;
@ -143,10 +155,10 @@ static int fdevent_poll_event_next_fdndx(fdevents *ev, int ndx) {
i = (ndx < 0) ? 0 : ndx + 1;
for (; i < ev->used; i++) {
if (ev->pollfds[i].revents) break;
if (ev->pollfds[i].revents) return i;
}
return i;
return -1;
}
int fdevent_poll_init(fdevents *ev) {
@ -174,8 +186,9 @@ int fdevent_poll_init(fdevents *ev) {
int fdevent_poll_init(fdevents *ev) {
UNUSED(ev);
fprintf(stderr, "%s.%d: poll is not supported, try to set server.event-handler = \"select\"\n",
__FILE__, __LINE__);
log_error_write(srv, __FILE__, __LINE__,
"s", "poll is not supported, try to set server.event-handler = \"select\"");
return -1;
}
#endif

9
src/fdevent_select.c

@ -1,5 +1,6 @@
#include "fdevent.h"
#include "buffer.h"
#include "log.h"
#include <sys/time.h>
#include <sys/types.h>
@ -95,12 +96,12 @@ static int fdevent_select_event_next_fdndx(fdevents *ev, int ndx) {
i = (ndx < 0) ? 0 : ndx + 1;
for (; i < ev->select_max_fd + 1; i++) {
if (FD_ISSET(i, &(ev->select_read))) break;
if (FD_ISSET(i, &(ev->select_write))) break;
if (FD_ISSET(i, &(ev->select_error))) break;
if (FD_ISSET(i, &(ev->select_read))) return i;
if (FD_ISSET(i, &(ev->select_write))) return i;
if (FD_ISSET(i, &(ev->select_error))) return i;
}
return i;
return -1;
}
int fdevent_select_init(fdevents *ev) {

49
src/fdevent_solaris_devpoll.c

@ -1,5 +1,6 @@
#include "fdevent.h"
#include "buffer.h"
#include "log.h"
#include <sys/types.h>
@ -30,9 +31,8 @@ static int fdevent_solaris_devpoll_event_del(fdevents *ev, int fde_ndx, int fd)
pfd.revents = 0;
if (-1 == write(ev->devpoll_fd, &pfd, sizeof(pfd))) {
fprintf(stderr, "%s.%d: (del) write failed: (%d, %s)\n",
__FILE__, __LINE__,
fd, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "S(D, S)",
"(del) write failed: ", fd, strerror(errno));
return -1;
}
@ -44,16 +44,19 @@ static int fdevent_solaris_devpoll_event_add(fdevents *ev, int fde_ndx, int fd,
struct pollfd pfd;
int add = 0;
int pevents = 0;
if (events & FDEVENT_IN) pevents |= POLLIN;
if (events & FDEVENT_OUT) pevents |= POLLOUT;
if (fde_ndx == -1) add = 1;
pfd.fd = fd;
pfd.events = events;
pfd.events = pevents;
pfd.revents = 0;
if (-1 == write(ev->devpoll_fd, &pfd, sizeof(pfd))) {
fprintf(stderr, "%s.%d: (del) write failed: (%d, %s)\n",
__FILE__, __LINE__,
fd, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "S(D, S)",
"(add) write failed: ", fd, strerror(errno));
return -1;
}
@ -75,7 +78,21 @@ static int fdevent_solaris_devpoll_poll(fdevents *ev, int timeout_ms) {
}
static int fdevent_solaris_devpoll_event_get_revent(fdevents *ev, size_t ndx) {
return ev->devpollfds[ndx].revents;
int r, poll_r;
r = 0;
poll_r = ev->devpollfds[ndx].revents;
/* map POLL* to FDEVEN_*; they are probably the same, but still. */
if (poll_r & POLLIN) r |= FDEVENT_IN;
if (poll_r & POLLOUT) r |= FDEVENT_OUT;
if (poll_r & POLLERR) r |= FDEVENT_ERR;
if (poll_r & POLLHUP) r |= FDEVENT_HUP;
if (poll_r & POLLNVAL) r |= FDEVENT_NVAL;
if (poll_r & POLLPRI) r |= FDEVENT_PRI;
return r;
}
static int fdevent_solaris_devpoll_event_get_fd(fdevents *ev, size_t ndx) {
@ -96,15 +113,15 @@ int fdevent_solaris_devpoll_reset(fdevents *ev) {
/* a forked process does only inherit the filedescriptor,
* but every operation on the device will lead to a EACCES */
if ((ev->devpoll_fd = open("/dev/poll", O_RDWR)) < 0) {
fprintf(stderr, "%s.%d: opening /dev/poll failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
"opening /dev/poll failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
return -1;
}
if (fcntl(ev->devpoll_fd, F_SETFD, FD_CLOEXEC) < 0) {
fprintf(stderr, "%s.%d: opening /dev/poll failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
"fcntl /dev/poll fd failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
close(ev->devpoll_fd);
@ -131,8 +148,8 @@ int fdevent_solaris_devpoll_init(fdevents *ev) {
ev->devpollfds = malloc(sizeof(*ev->devpollfds) * ev->maxfds);
if ((ev->devpoll_fd = open("/dev/poll", O_RDWR)) < 0) {
fprintf(stderr, "%s.%d: opening /dev/poll failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__, strerror(errno));
log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
"opening /dev/poll failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
return -1;
}
@ -149,8 +166,8 @@ int fdevent_solaris_devpoll_init(fdevents *ev) {
int fdevent_solaris_devpoll_init(fdevents *ev) {
UNUSED(ev);
fprintf(stderr, "%s.%d: solaris-devpoll not supported, try to set server.event-handler = \"poll\" or \"select\"\n",
__FILE__, __LINE__);
log_error_write(ev->srv, __FILE__, __LINE__, "S",
"solaris-devpoll not supported, try to set server.event-handler = \"poll\" or \"select\"");
return -1;
}

5
src/http_auth.c

@ -653,7 +653,6 @@ static int http_auth_basic_password_compare(server *srv, mod_auth_plugin_data *p
*/
if (password->used < 13 + 1) {
fprintf(stderr, "%s.%d\n", __FILE__, __LINE__);
return -1;
}
@ -664,7 +663,6 @@ static int http_auth_basic_password_compare(server *srv, mod_auth_plugin_data *p
char *dollar = NULL;
if (NULL == (dollar = strchr(password->ptr + 3, '$'))) {
fprintf(stderr, "%s.%d\n", __FILE__, __LINE__);
return -1;
}
@ -672,7 +670,6 @@ static int http_auth_basic_password_compare(server *srv, mod_auth_plugin_data *p
}
if (salt_len > sizeof(salt) - 1) {
fprintf(stderr, "%s.%d\n", __FILE__, __LINE__);
return -1;
}
@ -684,8 +681,6 @@ static int http_auth_basic_password_compare(server *srv, mod_auth_plugin_data *p
if (0 == strcmp(password->ptr, crypted)) {
return 0;
} else {
fprintf(stderr, "%s.%d\n", __FILE__, __LINE__);
}
#endif

6
src/keyvalue.c

@ -1,5 +1,6 @@
#include "server.h"
#include "keyvalue.h"
#include "log.h"
#include <stdlib.h>
#include <string.h>
@ -312,7 +313,7 @@ pcre_keyvalue_buffer *pcre_keyvalue_buffer_init(void) {
return kvb;
}
int pcre_keyvalue_buffer_append(pcre_keyvalue_buffer *kvb, const char *key, const char *value) {
int pcre_keyvalue_buffer_append(server *srv, pcre_keyvalue_buffer *kvb, const char *key, const char *value) {
#ifdef HAVE_PCRE_H
size_t i;
const char *errptr;
@ -346,7 +347,8 @@ int pcre_keyvalue_buffer_append(pcre_keyvalue_buffer *kvb, const char *key, cons
if (NULL == (kv->key = pcre_compile(key,
0, &errptr, &erroff, NULL))) {
fprintf(stderr, "%s.%d: rexexp compilation error at %s\n", __FILE__, __LINE__, errptr);
log_error_write(srv, __FILE__, __LINE__, "SS",
"rexexp compilation error at ", errptr);
return -1;
}

4
src/keyvalue.h

@ -9,6 +9,8 @@
# include <pcre.h>
#endif
struct server;
typedef enum {
HTTP_METHOD_UNSET = -1,
HTTP_METHOD_GET,
@ -102,7 +104,7 @@ int httpauth_keyvalue_buffer_append(httpauth_keyvalue_buffer *kvb, const char *k
void httpauth_keyvalue_buffer_free(httpauth_keyvalue_buffer *kvb);
pcre_keyvalue_buffer *pcre_keyvalue_buffer_init(void);
int pcre_keyvalue_buffer_append(pcre_keyvalue_buffer *kvb, const char *key, const char *value);
int pcre_keyvalue_buffer_append(struct server *srv, pcre_keyvalue_buffer *kvb, const char *key, const char *value);
void pcre_keyvalue_buffer_free(pcre_keyvalue_buffer *kvb);
#endif

3
src/mod_cgi.c

@ -609,8 +609,7 @@ static handler_t cgi_connection_close_callback(server *srv, connection *con, voi
}
static handler_t cgi_handle_fdevent(void *s, void *ctx, int revents) {
server *srv = (server *)s;
static handler_t cgi_handle_fdevent(server *srv, void *ctx, int revents) {
handler_ctx *hctx = ctx;
connection *con = hctx->remote_conn;

2
src/mod_dirlisting.c

@ -924,7 +924,7 @@ URIHANDLER_FUNC(mod_dirlisting_subrequest) {
}
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
fprintf(stderr, "%s.%d: %s\n", __FILE__, __LINE__, con->physical.path->ptr);
log_error_write(srv, __FILE__, __LINE__, "SB", "stat_cache_get_entry failed: ", con->physical.path);
SEGFAULT();
}

15
src/mod_extforward.c

@ -16,6 +16,7 @@
#include <string.h>
#include <stdio.h>
#include <netinet/in.h>
#include <errno.h>
/**
* mod_extforward.c for lighttpd, by comman.kang <at> gmail <dot> com
@ -302,7 +303,7 @@ static const char *last_not_in_array(array *a, plugin_data *p)
return NULL;
}
static struct addrinfo *ipstr_to_sockaddr(const char *host) {
static struct addrinfo *ipstr_to_sockaddr(server *srv, const char *host) {
struct addrinfo hints, *res0;
int result;
@ -319,17 +320,17 @@ static struct addrinfo *ipstr_to_sockaddr(const char *host) {
#endif
hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
errno = 0;
result = getaddrinfo(host, NULL, &hints, &res0);
if (result != 0) {
fprintf(stderr, "could not resolve hostname %s because %s\n", host, gai_strerror(result));
if (result == EAI_SYSTEM)
perror("The system error is ");
log_error_write(srv, __FILE__, __LINE__, "SSSs(S)",
"could not resolve hostname ", host, " because ", gai_strerror(result), strerror(errno));
return NULL;
} else if (res0 == 0) {
fprintf(stderr, "Problem in resolving hostname %s: succeeded, but no information returned\n", host);
log_error_write(srv, __FILE__, __LINE__, "SSS",
"Problem in resolving hostname ", host, ": succeeded, but no information returned");
}
return res0;
@ -424,7 +425,7 @@ URIHANDLER_FUNC(mod_extforward_uri_handler) {
log_error_write(srv, __FILE__, __LINE__, "ss", "using address:", real_remote_addr);
}
#ifdef HAVE_IPV6
addrlist = ipstr_to_sockaddr(real_remote_addr);
addrlist = ipstr_to_sockaddr(srv, real_remote_addr);
sock.plain.sa_family = AF_UNSPEC;
for (addrs_left = addrlist; addrs_left != NULL; addrs_left = addrs_left -> ai_next) {
sock.plain.sa_family = addrs_left->ai_family;

19
src/mod_fastcgi.c

@ -370,7 +370,7 @@ typedef struct {
/* ok, we need a prototype */
static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents);
static handler_t fcgi_handle_fdevent(server *srv, void *ctx, int revents);
static void reset_signals(void) {
#ifdef SIGTTOU
@ -2195,20 +2195,6 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
hctx->wb->bytes_in += sizeof(header);
#if 0
for (i = 0; i < hctx->write_buffer->used; i++) {
fprintf(stderr, "%02x ", hctx->write_buffer->ptr[i]);
if ((i+1) % 16 == 0) {
size_t j;
for (j = i-15; j <= i; j++) {
fprintf(stderr, "%c",
isprint((unsigned char)hctx->write_buffer->ptr[j]) ? hctx->write_buffer->ptr[j] : '.');
}
fprintf(stderr, "\n");
}
}
#endif
return 0;
}
@ -3265,8 +3251,7 @@ SUBREQUEST_FUNC(mod_fastcgi_handle_subrequest) {
}
}
static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents) {
server *srv = (server *)s;
static handler_t fcgi_handle_fdevent(server *srv, void *ctx, int revents) {
handler_ctx *hctx = ctx;
connection *con = hctx->remote_conn;
plugin_data *p = hctx->plugin_data;

5
src/mod_proxy.c

@ -112,7 +112,7 @@ typedef struct {
/* ok, we need a prototype */
static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents);
static handler_t proxy_handle_fdevent(server *srv, void *ctx, int revents);
static handler_ctx * handler_ctx_init() {
handler_ctx * hctx;
@ -974,8 +974,7 @@ SUBREQUEST_FUNC(mod_proxy_handle_subrequest) {
}
}
static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents) {
server *srv = (server *)s;
static handler_t proxy_handle_fdevent(server *srv, void *ctx, int revents) {
handler_ctx *hctx = ctx;
connection *con = hctx->remote_conn;
plugin_data *p = hctx->plugin_data;

2
src/mod_redirect.c

@ -118,7 +118,7 @@ SETDEFAULTS_FUNC(mod_redirect_set_defaults) {
return HANDLER_ERROR;
}
if (0 != pcre_keyvalue_buffer_append(s->redirect,
if (0 != pcre_keyvalue_buffer_append(srv, s->redirect,
((data_string *)(da->value->data[j]))->key->ptr,
((data_string *)(da->value->data[j]))->value->ptr)) {

19
src/mod_scgi.c

@ -328,7 +328,7 @@ typedef struct {
/* ok, we need a prototype */
static handler_t scgi_handle_fdevent(void *s, void *ctx, int revents);
static handler_t scgi_handle_fdevent(server *srv, void *ctx, int revents);
int scgi_proclist_sort_down(server *srv, scgi_extension_host *host, scgi_proc *proc);
@ -1676,20 +1676,6 @@ static int scgi_create_env(server *srv, handler_ctx *hctx) {
}
}
#if 0
for (i = 0; i < hctx->write_buffer->used; i++) {
fprintf(stderr, "%02x ", hctx->write_buffer->ptr[i]);
if ((i+1) % 16 == 0) {
size_t j;
for (j = i-15; j <= i; j++) {
fprintf(stderr, "%c",
isprint((unsigned char)hctx->write_buffer->ptr[j]) ? hctx->write_buffer->ptr[j] : '.');
}
fprintf(stderr, "\n");
}
}
#endif
return 0;
}
@ -2494,8 +2480,7 @@ static handler_t scgi_connection_close(server *srv, handler_ctx *hctx) {
}
static handler_t scgi_handle_fdevent(void *s, void *ctx, int revents) {
server *srv = (server *)s;
static handler_t scgi_handle_fdevent(server *srv, void *ctx, int revents) {
handler_ctx *hctx = ctx;
connection *con = hctx->remote_conn;
plugin_data *p = hctx->plugin_data;

3
src/network.c

@ -27,8 +27,7 @@
# include <openssl/rand.h>
#endif
static handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
server *srv = (server *)s;
static handler_t network_server_handle_fdevent(server *srv, void *context, int revents) {
server_socket *srv_socket = (server_socket *)context;
connection *con;
int loops = 0;

4
src/server.c

@ -1103,7 +1103,7 @@ int main (int argc, char **argv) {
}
#endif
if (NULL == (srv->ev = fdevent_init(srv->max_fds + 1, srv->event_handler))) {
if (NULL == (srv->ev = fdevent_init(srv, srv->max_fds + 1, srv->event_handler))) {
log_error_write(srv, __FILE__, __LINE__,
"s", "fdevent_init failed");
return -1;
@ -1435,6 +1435,8 @@ int main (int argc, char **argv) {
handler_t r;
fd_ndx = fdevent_event_next_fdndx (srv->ev, fd_ndx);
if (-1 == fd_ndx) break; /* not all fdevent handlers know how many fds got an event */
revents = fdevent_event_get_revent (srv->ev, fd_ndx);
fd = fdevent_event_get_fd (srv->ev, fd_ndx);
handler = fdevent_get_handler(srv->ev, fd);

6
src/stat_cache.c

@ -238,9 +238,8 @@ static uint32_t hashme(buffer *str) {
}
#ifdef HAVE_FAM_H
handler_t stat_cache_handle_fdevent(void *_srv, void *_fce, int revent) {
handler_t stat_cache_handle_fdevent(server *srv, void *_fce, int revent) {