From f8d0a97a94fdc45fb7eefd54b475d0197d624eba Mon Sep 17 00:00:00 2001 From: robs Date: Tue, 22 Oct 2002 01:02:18 +0000 Subject: [PATCH] clear up some gcc -Wall warnings --- fcgi_buf.c | 8 ++++++-- fcgi_config.c | 4 ++-- fcgi_pm.c | 5 ++++- fcgi_protocol.c | 18 +++++++++++------- fcgi_util.c | 7 ++++++- mod_fastcgi.c | 24 ++++++++++++++++++++---- 6 files changed, 49 insertions(+), 17 deletions(-) diff --git a/fcgi_buf.c b/fcgi_buf.c index b9e1d5c..1aedac1 100644 --- a/fcgi_buf.c +++ b/fcgi_buf.c @@ -1,11 +1,15 @@ /* - * $Id: fcgi_buf.c,v 1.15 2002/03/12 13:06:29 robs Exp $ + * $Id: fcgi_buf.c,v 1.16 2002/10/22 01:02:18 robs Exp $ */ #include "fcgi.h" #ifdef WIN32 -#pragma warning( disable : 4127 ) +#pragma warning( disable : 4127 ) +#else +#ifdef APACHE2 +#include +#endif #endif /******************************************************************************* diff --git a/fcgi_config.c b/fcgi_config.c index 8f79a8f..0ca401e 100644 --- a/fcgi_config.c +++ b/fcgi_config.c @@ -1,5 +1,5 @@ /* - * $Id: fcgi_config.c,v 1.43 2002/10/21 23:55:46 robs Exp $ + * $Id: fcgi_config.c,v 1.44 2002/10/22 01:02:18 robs Exp $ */ #define CORE_PRIVATE @@ -520,7 +520,7 @@ const char *fcgi_config_set_wrapper(cmd_parms *cmd, void *dummy, const char *arg const char *err = NULL; const char * const name = cmd->cmd->name; pool * const tp = cmd->temp_pool; - char * wrapper; + char * wrapper = NULL; err = fcgi_config_set_fcgi_uid_n_gid(1); if (err != NULL) diff --git a/fcgi_pm.c b/fcgi_pm.c index c0abec7..7d62101 100644 --- a/fcgi_pm.c +++ b/fcgi_pm.c @@ -1,5 +1,5 @@ /* - * $Id: fcgi_pm.c,v 1.80 2002/10/11 00:07:03 robs Exp $ + * $Id: fcgi_pm.c,v 1.81 2002/10/22 01:02:18 robs Exp $ */ @@ -7,7 +7,10 @@ #if defined(APACHE2) && !defined(WIN32) #include +#include +#include #include "unixd.h" +#include "apr_signal.h" #endif #ifdef _HPUX_SOURCE diff --git a/fcgi_protocol.c b/fcgi_protocol.c index b532f8d..f42f144 100644 --- a/fcgi_protocol.c +++ b/fcgi_protocol.c @@ -1,5 +1,5 @@ /* - * $Id: fcgi_protocol.c,v 1.23 2002/07/23 00:54:18 robs Exp $ + * $Id: fcgi_protocol.c,v 1.24 2002/10/22 01:02:18 robs Exp $ */ #include "fcgi.h" @@ -406,10 +406,12 @@ int fcgi_protocol_dequeue(pool *p, fcgi_request *fr) { if (start != end) { - *end = '\0'; - ap_log_rerror(FCGI_LOG_ERR_NOERRNO, fr->r, "FastCGI: server \"%s\" stderr: %s", fr->fs_path, start); - } - end += strspn(++end, "\r\n"); + *end = '\0'; + ap_log_rerror(FCGI_LOG_ERR_NOERRNO, fr->r, + "FastCGI: server \"%s\" stderr: %s", fr->fs_path, start); + } + end++; + end += strspn(end, "\r\n"); fr->fs_stderr_len -= (end - start); start = end; } @@ -424,7 +426,8 @@ int fcgi_protocol_dequeue(pool *p, fcgi_request *fr) else if (fr->fs_stderr_len == FCGI_SERVER_MAX_STDERR_LINE_LEN) { /* Full buffer, dump it and complain */ - ap_log_rerror(FCGI_LOG_ERR_NOERRNO, fr->r, "FastCGI: server \"%s\" stderr: %s", fr->fs_path, fr->fs_stderr); + ap_log_rerror(FCGI_LOG_ERR_NOERRNO, fr->r, + "FastCGI: server \"%s\" stderr: %s", fr->fs_path, fr->fs_stderr); ap_log_rerror(FCGI_LOG_WARN_NOERRNO, fr->r, "FastCGI: too much stderr received from server \"%s\", " "increase FCGI_SERVER_MAX_STDERR_LINE_LEN (%d) and rebuild " @@ -440,7 +443,8 @@ int fcgi_protocol_dequeue(pool *p, fcgi_request *fr) if (!fr->readingEndRequestBody) { if (fr->dataLen != sizeof(FCGI_EndRequestBody)) { ap_log_rerror(FCGI_LOG_ERR_NOERRNO, fr->r, - "FastCGI: comm with server \"%s\" aborted: protocol error: invalid FCGI_END_REQUEST size: " + "FastCGI: comm with server \"%s\" aborted: protocol error: " + "invalid FCGI_END_REQUEST size: " "%d != sizeof(FCGI_EndRequestBody)(%d)", fr->fs_path, fr->dataLen, sizeof(FCGI_EndRequestBody)); return HTTP_INTERNAL_SERVER_ERROR; diff --git a/fcgi_util.c b/fcgi_util.c index 5455182..9804e04 100644 --- a/fcgi_util.c +++ b/fcgi_util.c @@ -1,5 +1,5 @@ /* - * $Id: fcgi_util.c,v 1.27 2002/10/21 23:54:24 robs Exp $ + * $Id: fcgi_util.c,v 1.28 2002/10/22 01:02:18 robs Exp $ */ #include "fcgi.h" @@ -11,6 +11,11 @@ #include #include #include + +#if APR_HAVE_ARPA_INET_H +#include +#endif + #include "unixd.h" #endif diff --git a/mod_fastcgi.c b/mod_fastcgi.c index bb26ea8..1951ec5 100644 --- a/mod_fastcgi.c +++ b/mod_fastcgi.c @@ -3,7 +3,7 @@ * * Apache server module for FastCGI. * - * $Id: mod_fastcgi.c,v 1.144 2002/10/19 02:09:29 robs Exp $ + * $Id: mod_fastcgi.c,v 1.145 2002/10/22 01:02:18 robs Exp $ * * Copyright (c) 1995-1996 Open Market, Inc. * @@ -71,6 +71,18 @@ #include "fcgi.h" +#ifdef APACHE2 +#ifndef WIN32 + +#include + +#if APR_HAVE_CTYPE_H +#include +#endif + +#endif +#endif + #ifndef timersub #define timersub(a, b, result) \ do { \ @@ -355,22 +367,22 @@ static apcb_t init_module(server_rec *s, pool *p) return APCB_OK; } +#ifdef WIN32 #ifdef APACHE2 static apcb_t fcgi_child_exit(void * dc) #else static apcb_t fcgi_child_exit(server_rec *dc0, pool *dc1) #endif { -#ifdef WIN32 /* Signal the PM thread to exit*/ SetEvent(fcgi_event_handles[TERM_EVENT]); /* Waiting on pm thread to exit */ WaitForSingleObject(fcgi_pm_thread, INFINITE); -#endif return APCB_OK; } +#endif /* WIN32 */ #ifdef APACHE2 static void fcgi_child_init(apr_pool_t * p, server_rec * dc) @@ -2267,7 +2279,7 @@ static int do_work(request_rec * const r, fcgi_request * const fr) sink_client_data(fr); } - while (rv == 0 && BufferLength(fr->serverInputBuffer) || BufferLength(fr->clientOutputBuffer)) + while (rv == 0 && (BufferLength(fr->serverInputBuffer) || BufferLength(fr->clientOutputBuffer))) { if (fcgi_protocol_dequeue(rp, fr)) { @@ -2864,7 +2876,11 @@ module MODULE_VAR_EXPORT fastcgi_module = { NULL, /* [10] logger */ NULL, /* [3] header-parser */ fcgi_child_init, /* process initialization */ +#ifdef WIN32 fcgi_child_exit, /* process exit/cleanup */ +#else + NULL, +#endif NULL /* [1] post read-request handling */ }; -- 2.11.4.GIT