Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2414 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
parent
c60b60e7f0
commit
63f785a2f8
2
NEWS
2
NEWS
|
@ -4,7 +4,7 @@ NEWS
|
|||
====
|
||||
|
||||
- 1.4.23 -
|
||||
*
|
||||
* Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
|
||||
|
||||
- 1.4.22 - 2009-03-07
|
||||
* Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)
|
||||
|
|
|
@ -29,6 +29,18 @@ OPTION(WITH_FAM "fam/gamin for reducing number of stat() calls [default: off]")
|
|||
OPTION(WITH_GDBM "gdbm storage for mod_trigger_b4_dl [default: off]")
|
||||
OPTION(WITH_MEMCACHE "memcached storage for mod_trigger_b4_dl [default: off]")
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||
OPTION(BUILD_EXTRA_WARNINGS "extra warnings")
|
||||
|
||||
IF(BUILD_EXTRA_WARNINGS)
|
||||
SET(WARN_FLAGS "-g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wno-pointer-sign -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wformat-security")
|
||||
# -Wl,--as-needed
|
||||
# -Werror -Wbad-function-cast -Wmissing-prototypes
|
||||
ELSE(BUILD_EXTRA_WARNINGS)
|
||||
SET(WARN_FLAGS "")
|
||||
ENDIF(BUILD_EXTRA_WARNINGS)
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
OPTION(BUILD_STATIC "build a static lighttpd with all modules added")
|
||||
|
||||
IF(BUILD_STATIC)
|
||||
|
@ -549,7 +561,7 @@ IF(HAVE_MEMCACHE_H)
|
|||
ENDIF(HAVE_MEMCACHE_H)
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -g -Wshadow -W -pedantic")
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -g -Wshadow -W -pedantic ${WARN_FLAGS}")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
|
||||
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2")
|
||||
|
|
|
@ -181,7 +181,7 @@ int config_insert_values_global(server *srv, array *ca, const config_values_t cv
|
|||
return config_insert_values_internal(srv, ca, cv);
|
||||
}
|
||||
|
||||
unsigned short sock_addr_get_port(sock_addr *addr) {
|
||||
static unsigned short sock_addr_get_port(sock_addr *addr) {
|
||||
#ifdef HAVE_IPV6
|
||||
return ntohs(addr->plain.sa_family ? addr->ipv6.sin6_port : addr->ipv4.sin_port);
|
||||
#else
|
||||
|
|
|
@ -858,7 +858,7 @@ int connection_reset(server *srv, connection *con) {
|
|||
*
|
||||
* we get called by the state-engine and by the fdevent-handler
|
||||
*/
|
||||
int connection_handle_read_state(server *srv, connection *con) {
|
||||
static int connection_handle_read_state(server *srv, connection *con) {
|
||||
connection_state_t ostate = con->state;
|
||||
chunk *c, *last_chunk;
|
||||
off_t last_offset;
|
||||
|
@ -1156,7 +1156,7 @@ int connection_handle_read_state(server *srv, connection *con) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
handler_t connection_handle_fdevent(void *s, void *context, int revents) {
|
||||
static handler_t connection_handle_fdevent(void *s, void *context, int revents) {
|
||||
server *srv = (server *)s;
|
||||
connection *con = context;
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ int fdevent_reset(fdevents *ev) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
fdnode *fdnode_init() {
|
||||
static fdnode *fdnode_init() {
|
||||
fdnode *fdn;
|
||||
|
||||
fdn = calloc(1, sizeof(*fdn));
|
||||
|
@ -100,7 +100,7 @@ fdnode *fdnode_init() {
|
|||
return fdn;
|
||||
}
|
||||
|
||||
void fdnode_free(fdnode *fdn) {
|
||||
static void fdnode_free(fdnode *fdn) {
|
||||
free(fdn);
|
||||
}
|
||||
|
||||
|
|
|
@ -175,6 +175,7 @@ URIHANDLER_FUNC(mod_access_uri_handler) {
|
|||
}
|
||||
|
||||
|
||||
int mod_access_plugin_init(plugin *p);
|
||||
int mod_access_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("access");
|
||||
|
|
|
@ -156,7 +156,7 @@ INIT_FUNC(mod_accesslog_init) {
|
|||
return p;
|
||||
}
|
||||
|
||||
int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
|
||||
static int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
|
||||
size_t i, j, k = 0, start = 0;
|
||||
|
||||
if (format->used == 0) return -1;
|
||||
|
@ -876,6 +876,7 @@ REQUESTDONE_FUNC(log_access_write) {
|
|||
}
|
||||
|
||||
|
||||
int mod_accesslog_plugin_init(plugin *p);
|
||||
int mod_accesslog_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("accesslog");
|
||||
|
|
|
@ -187,6 +187,7 @@ PHYSICALPATH_FUNC(mod_alias_physical_handler) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_alias_plugin_init(plugin *p);
|
||||
int mod_alias_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("alias");
|
||||
|
|
|
@ -614,6 +614,7 @@ handler_t auth_ldap_init(server *srv, mod_auth_plugin_config *s) {
|
|||
#endif
|
||||
}
|
||||
|
||||
int mod_auth_plugin_init(plugin *p);
|
||||
int mod_auth_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("auth");
|
||||
|
|
|
@ -1369,6 +1369,7 @@ SUBREQUEST_FUNC(mod_cgi_handle_subrequest) {
|
|||
}
|
||||
|
||||
|
||||
int mod_cgi_plugin_init(plugin *p);
|
||||
int mod_cgi_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("cgi");
|
||||
|
|
|
@ -178,7 +178,7 @@ static int mod_cml_patch_connection(server *srv, connection *con, plugin_data *p
|
|||
}
|
||||
#undef PATCH
|
||||
|
||||
int cache_call_lua(server *srv, connection *con, plugin_data *p, buffer *cml_file) {
|
||||
static int cache_call_lua(server *srv, connection *con, plugin_data *p, buffer *cml_file) {
|
||||
buffer *b;
|
||||
char *c;
|
||||
|
||||
|
@ -305,6 +305,7 @@ URIHANDLER_FUNC(mod_cml_is_handled) {
|
|||
}
|
||||
}
|
||||
|
||||
int mod_cml_plugin_init(plugin *p);
|
||||
int mod_cml_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("cache");
|
||||
|
|
|
@ -93,7 +93,7 @@ int f_file_mtime(lua_State *L) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int f_dir_files_iter(lua_State *L) {
|
||||
static int f_dir_files_iter(lua_State *L) {
|
||||
DIR *d;
|
||||
struct dirent *de;
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ static int c_to_lua_push(lua_State *L, int tbl, const char *key, size_t key_len,
|
|||
}
|
||||
|
||||
|
||||
int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) {
|
||||
static int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) {
|
||||
size_t is_key = 1;
|
||||
size_t i;
|
||||
char *key = NULL, *val = NULL;
|
||||
|
|
|
@ -104,7 +104,7 @@ FREE_FUNC(mod_compress_free) {
|
|||
}
|
||||
|
||||
/* 0 on success, -1 for error */
|
||||
int mkdir_recursive(char *dir) {
|
||||
static int mkdir_recursive(char *dir) {
|
||||
char *p = dir;
|
||||
|
||||
if (!dir || !dir[0])
|
||||
|
@ -126,7 +126,7 @@ int mkdir_recursive(char *dir) {
|
|||
}
|
||||
|
||||
/* 0 on success, -1 for error */
|
||||
int mkdir_for_file(char *filename) {
|
||||
static int mkdir_for_file(char *filename) {
|
||||
char *p = filename;
|
||||
|
||||
if (!filename || !filename[0])
|
||||
|
@ -815,6 +815,7 @@ PHYSICALPATH_FUNC(mod_compress_physical) {
|
|||
return HANDLER_GO_ON;
|
||||
}
|
||||
|
||||
int mod_compress_plugin_init(plugin *p);
|
||||
int mod_compress_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("compress");
|
||||
|
|
|
@ -73,7 +73,7 @@ typedef struct {
|
|||
plugin_config conf;
|
||||
} plugin_data;
|
||||
|
||||
excludes_buffer *excludes_buffer_init(void) {
|
||||
static excludes_buffer *excludes_buffer_init(void) {
|
||||
excludes_buffer *exb;
|
||||
|
||||
exb = calloc(1, sizeof(*exb));
|
||||
|
@ -81,7 +81,7 @@ excludes_buffer *excludes_buffer_init(void) {
|
|||
return exb;
|
||||
}
|
||||
|
||||
int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
|
||||
static int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
|
||||
#ifdef HAVE_PCRE_H
|
||||
size_t i;
|
||||
const char *errptr;
|
||||
|
@ -128,7 +128,7 @@ int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void excludes_buffer_free(excludes_buffer *exb) {
|
||||
static void excludes_buffer_free(excludes_buffer *exb) {
|
||||
#ifdef HAVE_PCRE_H
|
||||
size_t i;
|
||||
|
||||
|
@ -904,6 +904,7 @@ URIHANDLER_FUNC(mod_dirlisting_subrequest) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_dirlisting_plugin_init(plugin *p);
|
||||
int mod_dirlisting_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("dirlisting");
|
||||
|
|
|
@ -186,6 +186,7 @@ URIHANDLER_FUNC(mod_evasive_uri_handler) {
|
|||
}
|
||||
|
||||
|
||||
int mod_evasive_plugin_init(plugin *p);
|
||||
int mod_evasive_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("evasive");
|
||||
|
|
|
@ -318,6 +318,7 @@ static handler_t mod_evhost_uri_handler(server *srv, connection *con, void *p_d)
|
|||
return HANDLER_GO_ON;
|
||||
}
|
||||
|
||||
int mod_evhost_plugin_init(plugin *p);
|
||||
int mod_evhost_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("evhost");
|
||||
|
|
|
@ -354,6 +354,7 @@ URIHANDLER_FUNC(mod_expire_path_handler) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_expire_plugin_init(plugin *p);
|
||||
int mod_expire_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("expire");
|
||||
|
|
|
@ -294,7 +294,7 @@ static const char *last_not_in_array(array *a, plugin_data *p)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct addrinfo *ipstr_to_sockaddr(const char *host)
|
||||
static struct addrinfo *ipstr_to_sockaddr(const char *host)
|
||||
{
|
||||
struct addrinfo hints, *res0;
|
||||
int result;
|
||||
|
@ -479,6 +479,7 @@ CONNECTION_FUNC(mod_extforward_restore) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_extforward_plugin_init(plugin *p);
|
||||
int mod_extforward_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("extforward");
|
||||
|
|
|
@ -389,7 +389,7 @@ typedef struct {
|
|||
/* ok, we need a prototype */
|
||||
static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents);
|
||||
|
||||
int fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
|
||||
static int fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
|
||||
buffer_copy_string_len(b, CONST_STR_LEN("fastcgi.backend."));
|
||||
buffer_append_string_buffer(b, host->id);
|
||||
if (proc) {
|
||||
|
@ -400,7 +400,7 @@ int fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc
|
|||
return 0;
|
||||
}
|
||||
|
||||
int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
|
||||
static int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
|
||||
#define CLEAN(x) \
|
||||
fastcgi_status_copy_procname(b, host, proc); \
|
||||
buffer_append_string_len(b, CONST_STR_LEN(x)); \
|
||||
|
@ -465,7 +465,7 @@ static void handler_ctx_free(handler_ctx *hctx) {
|
|||
free(hctx);
|
||||
}
|
||||
|
||||
fcgi_proc *fastcgi_process_init() {
|
||||
static fcgi_proc *fastcgi_process_init() {
|
||||
fcgi_proc *f;
|
||||
|
||||
f = calloc(1, sizeof(*f));
|
||||
|
@ -478,7 +478,7 @@ fcgi_proc *fastcgi_process_init() {
|
|||
return f;
|
||||
}
|
||||
|
||||
void fastcgi_process_free(fcgi_proc *f) {
|
||||
static void fastcgi_process_free(fcgi_proc *f) {
|
||||
if (!f) return;
|
||||
|
||||
fastcgi_process_free(f->next);
|
||||
|
@ -489,7 +489,7 @@ void fastcgi_process_free(fcgi_proc *f) {
|
|||
free(f);
|
||||
}
|
||||
|
||||
fcgi_extension_host *fastcgi_host_init() {
|
||||
static fcgi_extension_host *fastcgi_host_init() {
|
||||
fcgi_extension_host *f;
|
||||
|
||||
f = calloc(1, sizeof(*f));
|
||||
|
@ -506,7 +506,7 @@ fcgi_extension_host *fastcgi_host_init() {
|
|||
return f;
|
||||
}
|
||||
|
||||
void fastcgi_host_free(fcgi_extension_host *h) {
|
||||
static void fastcgi_host_free(fcgi_extension_host *h) {
|
||||
if (!h) return;
|
||||
|
||||
buffer_free(h->id);
|
||||
|
@ -525,7 +525,7 @@ void fastcgi_host_free(fcgi_extension_host *h) {
|
|||
|
||||
}
|
||||
|
||||
fcgi_exts *fastcgi_extensions_init() {
|
||||
static fcgi_exts *fastcgi_extensions_init() {
|
||||
fcgi_exts *f;
|
||||
|
||||
f = calloc(1, sizeof(*f));
|
||||
|
@ -533,7 +533,7 @@ fcgi_exts *fastcgi_extensions_init() {
|
|||
return f;
|
||||
}
|
||||
|
||||
void fastcgi_extensions_free(fcgi_exts *f) {
|
||||
static void fastcgi_extensions_free(fcgi_exts *f) {
|
||||
size_t i;
|
||||
|
||||
if (!f) return;
|
||||
|
@ -563,7 +563,7 @@ void fastcgi_extensions_free(fcgi_exts *f) {
|
|||
free(f);
|
||||
}
|
||||
|
||||
int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
|
||||
static int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
|
||||
fcgi_extension *fe;
|
||||
size_t i;
|
||||
|
||||
|
@ -1479,7 +1479,7 @@ static int fcgi_requestid_del(server *srv, plugin_data *p, size_t request_id) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
void fcgi_connection_close(server *srv, handler_ctx *hctx) {
|
||||
static void fcgi_connection_close(server *srv, handler_ctx *hctx) {
|
||||
plugin_data *p;
|
||||
connection *con;
|
||||
|
||||
|
@ -3916,6 +3916,7 @@ TRIGGER_FUNC(mod_fastcgi_handle_trigger) {
|
|||
}
|
||||
|
||||
|
||||
int mod_fastcgi_plugin_init(plugin *p);
|
||||
int mod_fastcgi_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("fastcgi");
|
||||
|
|
|
@ -265,6 +265,7 @@ URIHANDLER_FUNC(mod_flv_streaming_path_handler) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_flv_streaming_plugin_init(plugin *p);
|
||||
int mod_flv_streaming_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("flv_streaming");
|
||||
|
|
|
@ -206,6 +206,7 @@ URIHANDLER_FUNC(mod_indexfile_subrequest) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_indexfile_plugin_init(plugin *p);
|
||||
int mod_indexfile_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("indexfile");
|
||||
|
|
|
@ -840,6 +840,7 @@ URIHANDLER_FUNC(mod_magnet_physical) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_magnet_plugin_init(plugin *p);
|
||||
int mod_magnet_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("magnet");
|
||||
|
@ -856,6 +857,7 @@ int mod_magnet_plugin_init(plugin *p) {
|
|||
}
|
||||
|
||||
#else
|
||||
int mod_magnet_plugin_init(plugin *p);
|
||||
int mod_magnet_plugin_init(plugin *p) {
|
||||
UNUSED(p);
|
||||
return -1;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <lualib.h>
|
||||
#include <lauxlib.h>
|
||||
|
||||
script *script_init() {
|
||||
static script *script_init() {
|
||||
script *sc;
|
||||
|
||||
sc = calloc(1, sizeof(*sc));
|
||||
|
@ -19,7 +19,7 @@ script *script_init() {
|
|||
return sc;
|
||||
}
|
||||
|
||||
void script_free(script *sc) {
|
||||
static void script_free(script *sc) {
|
||||
if (!sc) return;
|
||||
|
||||
lua_pop(sc->L, 1); /* the function copy */
|
||||
|
|
|
@ -422,6 +422,7 @@ ERR500: if (result) mysql_free_result(result);
|
|||
}
|
||||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
int mod_mysql_vhost_plugin_init(plugin *p);
|
||||
int mod_mysql_vhost_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("mysql_vhost");
|
||||
|
@ -437,6 +438,7 @@ int mod_mysql_vhost_plugin_init(plugin *p) {
|
|||
}
|
||||
#else
|
||||
/* we don't have mysql support, this plugin does nothing */
|
||||
int mod_mysql_vhost_plugin_init(plugin *p);
|
||||
int mod_mysql_vhost_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("mysql_vhost");
|
||||
|
|
|
@ -332,7 +332,7 @@ SETDEFAULTS_FUNC(mod_proxy_set_defaults) {
|
|||
return HANDLER_GO_ON;
|
||||
}
|
||||
|
||||
void proxy_connection_close(server *srv, handler_ctx *hctx) {
|
||||
static void proxy_connection_close(server *srv, handler_ctx *hctx) {
|
||||
plugin_data *p;
|
||||
connection *con;
|
||||
|
||||
|
@ -395,7 +395,7 @@ static int proxy_establish_connection(server *srv, handler_ctx *hctx) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void proxy_set_header(connection *con, const char *key, const char *value) {
|
||||
static void proxy_set_header(connection *con, const char *key, const char *value) {
|
||||
data_string *ds_dst;
|
||||
|
||||
if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
|
||||
|
@ -407,7 +407,7 @@ void proxy_set_header(connection *con, const char *key, const char *value) {
|
|||
array_insert_unique(con->request.headers, (data_unset *)ds_dst);
|
||||
}
|
||||
|
||||
void proxy_append_header(connection *con, const char *key, const char *value) {
|
||||
static void proxy_append_header(connection *con, const char *key, const char *value) {
|
||||
data_string *ds_dst;
|
||||
|
||||
if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
|
||||
|
@ -1321,6 +1321,7 @@ TRIGGER_FUNC(mod_proxy_trigger) {
|
|||
}
|
||||
|
||||
|
||||
int mod_proxy_plugin_init(plugin *p);
|
||||
int mod_proxy_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("proxy");
|
||||
|
|
|
@ -271,6 +271,7 @@ static handler_t mod_redirect_uri_handler(server *srv, connection *con, void *p_
|
|||
}
|
||||
|
||||
|
||||
int mod_redirect_plugin_init(plugin *p);
|
||||
int mod_redirect_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("redirect");
|
||||
|
|
|
@ -63,7 +63,7 @@ static void handler_ctx_free(handler_ctx *hctx) {
|
|||
free(hctx);
|
||||
}
|
||||
|
||||
rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
|
||||
static rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
|
||||
rewrite_rule_buffer *kvb;
|
||||
|
||||
kvb = calloc(1, sizeof(*kvb));
|
||||
|
@ -71,7 +71,7 @@ rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
|
|||
return kvb;
|
||||
}
|
||||
|
||||
int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
|
||||
static int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
|
||||
#ifdef HAVE_PCRE_H
|
||||
size_t i;
|
||||
const char *errptr;
|
||||
|
@ -121,7 +121,7 @@ int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *va
|
|||
#endif
|
||||
}
|
||||
|
||||
void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
|
||||
static void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
|
||||
#ifdef HAVE_PCRE_H
|
||||
size_t i;
|
||||
|
||||
|
@ -444,6 +444,7 @@ URIHANDLER_FUNC(mod_rewrite_uri_handler) {
|
|||
return HANDLER_GO_ON;
|
||||
}
|
||||
|
||||
int mod_rewrite_plugin_init(plugin *p);
|
||||
int mod_rewrite_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("rewrite");
|
||||
|
|
|
@ -91,7 +91,7 @@ FREE_FUNC(mod_rrd_free) {
|
|||
return HANDLER_GO_ON;
|
||||
}
|
||||
|
||||
int mod_rrd_create_pipe(server *srv, plugin_data *p) {
|
||||
static int mod_rrd_create_pipe(server *srv, plugin_data *p) {
|
||||
#ifdef HAVE_FORK
|
||||
pid_t pid;
|
||||
|
||||
|
@ -477,6 +477,7 @@ REQUESTDONE_FUNC(mod_rrd_account) {
|
|||
return HANDLER_GO_ON;
|
||||
}
|
||||
|
||||
int mod_rrdtool_plugin_init(plugin *p);
|
||||
int mod_rrdtool_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("rrd");
|
||||
|
|
|
@ -372,7 +372,7 @@ static void handler_ctx_free(handler_ctx *hctx) {
|
|||
free(hctx);
|
||||
}
|
||||
|
||||
scgi_proc *scgi_process_init() {
|
||||
static scgi_proc *scgi_process_init() {
|
||||
scgi_proc *f;
|
||||
|
||||
f = calloc(1, sizeof(*f));
|
||||
|
@ -384,7 +384,7 @@ scgi_proc *scgi_process_init() {
|
|||
return f;
|
||||
}
|
||||
|
||||
void scgi_process_free(scgi_proc *f) {
|
||||
static void scgi_process_free(scgi_proc *f) {
|
||||
if (!f) return;
|
||||
|
||||
scgi_process_free(f->next);
|
||||
|
@ -394,7 +394,7 @@ void scgi_process_free(scgi_proc *f) {
|
|||
free(f);
|
||||
}
|
||||
|
||||
scgi_extension_host *scgi_host_init() {
|
||||
static scgi_extension_host *scgi_host_init() {
|
||||
scgi_extension_host *f;
|
||||
|
||||
f = calloc(1, sizeof(*f));
|
||||
|
@ -409,7 +409,7 @@ scgi_extension_host *scgi_host_init() {
|
|||
return f;
|
||||
}
|
||||
|
||||
void scgi_host_free(scgi_extension_host *h) {
|
||||
static void scgi_host_free(scgi_extension_host *h) {
|
||||
if (!h) return;
|
||||
|
||||
buffer_free(h->host);
|
||||
|
@ -426,7 +426,7 @@ void scgi_host_free(scgi_extension_host *h) {
|
|||
|
||||
}
|
||||
|
||||
scgi_exts *scgi_extensions_init() {
|
||||
static scgi_exts *scgi_extensions_init() {
|
||||
scgi_exts *f;
|
||||
|
||||
f = calloc(1, sizeof(*f));
|
||||
|
@ -434,7 +434,7 @@ scgi_exts *scgi_extensions_init() {
|
|||
return f;
|
||||
}
|
||||
|
||||
void scgi_extensions_free(scgi_exts *f) {
|
||||
static void scgi_extensions_free(scgi_exts *f) {
|
||||
size_t i;
|
||||
|
||||
if (!f) return;
|
||||
|
@ -464,7 +464,7 @@ void scgi_extensions_free(scgi_exts *f) {
|
|||
free(f);
|
||||
}
|
||||
|
||||
int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
|
||||
static int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
|
||||
scgi_extension *fe;
|
||||
size_t i;
|
||||
|
||||
|
@ -1178,7 +1178,7 @@ static int scgi_set_state(server *srv, handler_ctx *hctx, scgi_connection_state_
|
|||
}
|
||||
|
||||
|
||||
void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
|
||||
static void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
|
||||
plugin_data *p;
|
||||
connection *con;
|
||||
|
||||
|
@ -1915,7 +1915,7 @@ static int scgi_demux_response(server *srv, handler_ctx *hctx) {
|
|||
}
|
||||
|
||||
|
||||
int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
|
||||
static int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
|
||||
scgi_proc *p;
|
||||
|
||||
UNUSED(srv);
|
||||
|
@ -3105,6 +3105,7 @@ TRIGGER_FUNC(mod_scgi_handle_trigger) {
|
|||
}
|
||||
|
||||
|
||||
int mod_scgi_plugin_init(plugin *p);
|
||||
int mod_scgi_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("scgi");
|
||||
|
|
|
@ -138,7 +138,7 @@ SETDEFAULTS_FUNC(mod_secdownload_set_defaults) {
|
|||
* @return if the supplied string is a valid MD5 string 1 is returned otherwise 0
|
||||
*/
|
||||
|
||||
int is_hex_len(const char *str, size_t len) {
|
||||
static int is_hex_len(const char *str, size_t len) {
|
||||
size_t i;
|
||||
|
||||
if (NULL == str) return 0;
|
||||
|
@ -293,6 +293,7 @@ URIHANDLER_FUNC(mod_secdownload_uri_handler) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_secdownload_plugin_init(plugin *p);
|
||||
int mod_secdownload_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("secdownload");
|
||||
|
|
|
@ -230,6 +230,7 @@ REQUESTDONE_FUNC(mod_setenv_reset) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_setenv_plugin_init(plugin *p);
|
||||
int mod_setenv_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("setenv");
|
||||
|
|
|
@ -270,6 +270,7 @@ static handler_t mod_simple_vhost_docroot(server *srv, connection *con, void *p_
|
|||
}
|
||||
|
||||
|
||||
int mod_simple_vhost_plugin_init(plugin *p);
|
||||
int mod_simple_vhost_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("simple_vhost");
|
||||
|
|
|
@ -139,7 +139,7 @@ SETDEFAULTS_FUNC(mod_ssi_set_defaults) {
|
|||
return HANDLER_GO_ON;
|
||||
}
|
||||
|
||||
int ssi_env_add(array *env, const char *key, const char *val) {
|
||||
static int ssi_env_add(array *env, const char *key, const char *val) {
|
||||
data_string *ds;
|
||||
|
||||
if (NULL == (ds = (data_string *)array_get_unused_element(env, TYPE_STRING))) {
|
||||
|
@ -1125,6 +1125,7 @@ URIHANDLER_FUNC(mod_ssi_physical_path) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_ssi_plugin_init(plugin *p);
|
||||
int mod_ssi_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("ssi");
|
||||
|
|
|
@ -532,6 +532,7 @@ URIHANDLER_FUNC(mod_staticfile_subrequest) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_staticfile_plugin_init(plugin *p);
|
||||
int mod_staticfile_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("staticfile");
|
||||
|
|
|
@ -853,6 +853,7 @@ REQUESTDONE_FUNC(mod_status_account) {
|
|||
return HANDLER_GO_ON;
|
||||
}
|
||||
|
||||
int mod_status_plugin_init(plugin *p);
|
||||
int mod_status_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("status");
|
||||
|
|
|
@ -576,6 +576,7 @@ TRIGGER_FUNC(mod_trigger_b4_dl_handle_trigger) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_trigger_b4_dl_plugin_init(plugin *p);
|
||||
int mod_trigger_b4_dl_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("trigger_b4_dl");
|
||||
|
|
|
@ -51,7 +51,7 @@ typedef struct {
|
|||
*/
|
||||
|
||||
/* init the plugin data */
|
||||
connection_map *connection_map_init() {
|
||||
static connection_map *connection_map_init() {
|
||||
connection_map *cm;
|
||||
|
||||
cm = calloc(1, sizeof(*cm));
|
||||
|
@ -59,7 +59,7 @@ connection_map *connection_map_init() {
|
|||
return cm;
|
||||
}
|
||||
|
||||
void connection_map_free(connection_map *cm) {
|
||||
static void connection_map_free(connection_map *cm) {
|
||||
size_t i;
|
||||
for (i = 0; i < cm->size; i++) {
|
||||
connection_map_entry *cme = cm->ptr[i];
|
||||
|
@ -75,7 +75,7 @@ void connection_map_free(connection_map *cm) {
|
|||
free(cm);
|
||||
}
|
||||
|
||||
int connection_map_insert(connection_map *cm, connection *con, buffer *con_id) {
|
||||
static int connection_map_insert(connection_map *cm, connection *con, buffer *con_id) {
|
||||
connection_map_entry *cme;
|
||||
size_t i;
|
||||
|
||||
|
@ -108,7 +108,7 @@ int connection_map_insert(connection_map *cm, connection *con, buffer *con_id) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
connection *connection_map_get_connection(connection_map *cm, buffer *con_id) {
|
||||
static connection *connection_map_get_connection(connection_map *cm, buffer *con_id) {
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < cm->used; i++) {
|
||||
|
@ -123,7 +123,7 @@ connection *connection_map_get_connection(connection_map *cm, buffer *con_id) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int connection_map_remove_connection(connection_map *cm, connection *con) {
|
||||
static int connection_map_remove_connection(connection_map *cm, connection *con) {
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < cm->used; i++) {
|
||||
|
@ -418,6 +418,7 @@ REQUESTDONE_FUNC(mod_uploadprogress_request_done) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_uploadprogress_plugin_init(plugin *p);
|
||||
int mod_uploadprogress_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("uploadprogress");
|
||||
|
|
|
@ -314,6 +314,7 @@ URIHANDLER_FUNC(mod_userdir_docroot_handler) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_userdir_plugin_init(plugin *p);
|
||||
int mod_userdir_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("userdir");
|
||||
|
|
|
@ -255,6 +255,7 @@ URIHANDLER_FUNC(mod_usertrack_uri_handler) {
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_usertrack_plugin_init(plugin *p);
|
||||
int mod_usertrack_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("usertrack");
|
||||
|
|
|
@ -1096,7 +1096,7 @@ static int webdav_parse_chunkqueue(server *srv, connection *con, plugin_data *p,
|
|||
}
|
||||
#endif
|
||||
|
||||
int webdav_lockdiscovery(server *srv, connection *con,
|
||||
static int webdav_lockdiscovery(server *srv, connection *con,
|
||||
buffer *locktoken, const char *lockscope, const char *locktype, int depth) {
|
||||
|
||||
buffer *b;
|
||||
|
@ -1156,7 +1156,7 @@ int webdav_lockdiscovery(server *srv, connection *con,
|
|||
*
|
||||
*
|
||||
*/
|
||||
int webdav_has_lock(server *srv, connection *con, plugin_data *p, buffer *uri) {
|
||||
static int webdav_has_lock(server *srv, connection *con, plugin_data *p, buffer *uri) {
|
||||
int has_lock = 1;
|
||||
|
||||
#ifdef USE_LOCKS
|
||||
|
@ -2474,6 +2474,7 @@ propmatch_cleanup:
|
|||
|
||||
/* this function is called at dlopen() time and inits the callbacks */
|
||||
|
||||
int mod_webdav_plugin_init(plugin *p);
|
||||
int mod_webdav_plugin_init(plugin *p) {
|
||||
p->version = LIGHTTPD_VERSION_ID;
|
||||
p->name = buffer_init_string("webdav");
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
# include <openssl/rand.h>
|
||||
#endif
|
||||
|
||||
handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
|
||||
static handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
|
||||
server *srv = (server *)s;
|
||||
server_socket *srv_socket = (server_socket *)context;
|
||||
connection *con;
|
||||
|
@ -62,7 +62,7 @@ handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
|
|||
return HANDLER_GO_ON;
|
||||
}
|
||||
|
||||
int network_server_init(server *srv, buffer *host_token, specific_config *s) {
|
||||
static int network_server_init(server *srv, buffer *host_token, specific_config *s) {
|
||||
int val;
|
||||
socklen_t addr_len;
|
||||
server_socket *srv_socket;
|
||||
|
|
|
@ -200,7 +200,7 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
|
|||
#define DUMP_HEADER
|
||||
#endif
|
||||
|
||||
int http_request_split_value(array *vals, buffer *b) {
|
||||
static int http_request_split_value(array *vals, buffer *b) {
|
||||
char *s;
|
||||
size_t i;
|
||||
int state = 0;
|
||||
|
@ -262,7 +262,7 @@ int http_request_split_value(array *vals, buffer *b) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int request_uri_is_valid_char(unsigned char c) {
|
||||
static int request_uri_is_valid_char(unsigned char c) {
|
||||
if (c <= 32) return 0;
|
||||
if (c == 127) return 0;
|
||||
if (c == 255) return 0;
|
||||
|
|
|
@ -37,7 +37,7 @@ typedef int socklen_t;
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_UN_H
|
||||
int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned short port, const char *unixsocket, int fork_count, int child_count, int pid_fd, int nofork) {
|
||||
static int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned short port, const char *unixsocket, int fork_count, int child_count, int pid_fd, int nofork) {
|
||||
int fcgi_fd;
|
||||
int socket_type, status, rc = 0;
|
||||
struct timeval tv = { 0, 100 * 1000 };
|
||||
|
@ -259,14 +259,14 @@ int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned sh
|
|||
}
|
||||
|
||||
|
||||
void show_version () {
|
||||
static void show_version () {
|
||||
char *b = "spawn-fcgi" "-" PACKAGE_VERSION \
|
||||
" - spawns fastcgi processes\n"
|
||||
;
|
||||
write(1, b, strlen(b));
|
||||
}
|
||||
|
||||
void show_help () {
|
||||
static void show_help () {
|
||||
char *b = \
|
||||
"Usage: spawn-fcgi [options] -- <fcgiapp> [fcgi app arguments]\n" \
|
||||
"\n" \
|
||||
|
|
|
@ -187,7 +187,8 @@ splay_tree * splaytree_delete(splay_tree *t, int i) {
|
|||
}
|
||||
}
|
||||
|
||||
splay_tree *find_rank(int r, splay_tree *t) {
|
||||
#if 0
|
||||
static splay_tree *find_rank(int r, splay_tree *t) {
|
||||
/* Returns a pointer to the node in the tree with the given rank. */
|
||||
/* Returns NULL if there is no such node. */
|
||||
/* Does not change the tree. To guarantee logarithmic behavior, */
|
||||
|
@ -206,5 +207,4 @@ splay_tree *find_rank(int r, splay_tree *t) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue