libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 021297349b7c6a3ea4ac8aeabec661567c0750cc
parent 1110c2bdbe975167456cc5d3a859e791e9d6c6fa
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  1 Apr 2010 21:53:24 +0000

allow NULL for max arg to get_fdset

Diffstat:
MChangeLog | 3+++
Mconfigure.ac | 6+++---
Msrc/daemon/connection.c | 3++-
Msrc/daemon/daemon.c | 10+++++++++-
Msrc/include/microhttpd.h | 4++--
5 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,6 @@ +Sat Mar 13 09:41:01 CET 2010 + Releasing libmicrohttpd 0.4.6. -CG + Wed Mar 10 13:18:26 CET 2010 Fixing bug in 100 CONTINUE replacement when handling POSTs (see report on mailinglist), with testcase. -CG/MC diff --git a/configure.ac b/configure.ac @@ -21,14 +21,14 @@ # # AC_PREREQ(2.57) -AC_INIT([libmicrohttpd], [0.4.5],[libmicrohttpd@gnu.org]) -AM_INIT_AUTOMAKE([libmicrohttpd], [0.4.5]) +AC_INIT([libmicrohttpd], [0.4.6],[libmicrohttpd@gnu.org]) +AM_INIT_AUTOMAKE([libmicrohttpd], [0.4.6]) AM_CONFIG_HEADER([MHD_config.h]) AC_CONFIG_MACRO_DIR([m4]) AH_TOP([#define _GNU_SOURCE 1]) LIB_VERSION_CURRENT=7 -LIB_VERSION_REVISION=0 +LIB_VERSION_REVISION=1 LIB_VERSION_AGE=2 AC_SUBST(LIB_VERSION_CURRENT) AC_SUBST(LIB_VERSION_REVISION) diff --git a/src/daemon/connection.c b/src/daemon/connection.c @@ -693,7 +693,8 @@ static void do_fd_set (int fd, fd_set * set, int *max_fd) { FD_SET (fd, set); - if (fd > *max_fd) + if ( (NULL != max_fd) && + (fd > *max_fd) ) *max_fd = fd; } diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c @@ -439,6 +439,12 @@ MHD_TLS_init (struct MHD_Daemon *daemon) /** * Obtain the select sets for this daemon. * + * @param daemon daemon to get sets from + * @param read_fd_set read set + * @param write_fd_set write set + * @param except_fd_set except set + * @param max_fd increased to largest FD added (if larger + * than existing value); can be NULL * @return MHD_YES on success, MHD_NO if this * daemon was not started with the right * options for this call. @@ -460,7 +466,8 @@ MHD_get_fdset (struct MHD_Daemon *daemon, FD_SET (fd, read_fd_set); /* update max file descriptor */ - if ((*max_fd) < fd) + if ( (NULL != max_fd) && + ((*max_fd) < fd) ) *max_fd = fd; con_itr = daemon->connections; @@ -908,6 +915,7 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon) * returned value is how long select should at most * block, not the timeout value set for connections. * + * @param daemon daemon to query for timeout * @param timeout set to the timeout (in milliseconds) * @return MHD_YES on success, MHD_NO if timeouts are * not used (or no connections exist that would diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h @@ -81,7 +81,7 @@ extern "C" /** * Current version of the library. */ -#define MHD_VERSION 0x00040500 +#define MHD_VERSION 0x00040600 /** * MHD-internal return code for "YES". @@ -930,7 +930,7 @@ void MHD_stop_daemon (struct MHD_Daemon *daemon); * @param write_fd_set write set * @param except_fd_set except set * @param max_fd increased to largest FD added (if larger - * than existing value) + * than existing value); can be NULL * @return MHD_YES on success, MHD_NO if this * daemon was not started with the right * options for this call.