From: Paul Querna Date: Wed, 29 Oct 2008 08:33:26 +0000 (+0000) Subject: Cleanup mod_dialup to compile with -std=c89 and -pedantic. X-Git-Tag: 2.3.0~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9733c2a562e13417855c9c9bfeec041482871f37;p=thirdparty%2Fapache%2Fhttpd.git Cleanup mod_dialup to compile with -std=c89 and -pedantic. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708825 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/test/mod_dialup.c b/modules/test/mod_dialup.c index 349cd2c6e6e..73ca25fe952 100644 --- a/modules/test/mod_dialup.c +++ b/modules/test/mod_dialup.c @@ -17,15 +17,19 @@ #include "httpd.h" +/* to detect sendfile enabled, we need CORE_PRIVATE. Someone should fix this. */ +#define CORE_PRIVATE +#include "http_core.h" + #include "util_filter.h" #include "http_log.h" #include "http_config.h" #include "http_request.h" +#include "http_protocol.h" + -/* to detect sendfile enabled, we need CORE_PRIVATE. Someone should fix this. */ -#define CORE_PRIVATE -#include "http_core.h" +#include "ap_mpm.h" module AP_MODULE_DECLARE_DATA dialup_module; @@ -137,6 +141,12 @@ dialup_handler(request_rec *r) { int status; apr_status_t rv; + dialup_dcfg_t *dcfg; + core_dir_config *ccfg; + apr_file_t *fd; + dialup_baton_t *db; + apr_bucket *e; + /* See core.c, default handler for all of the cases we just decline. */ if (r->method_number != M_GET || @@ -145,15 +155,16 @@ dialup_handler(request_rec *r) return DECLINED; } - dialup_dcfg_t *dcfg = ap_get_module_config(r->per_dir_config, - &dialup_module); + dcfg = ap_get_module_config(r->per_dir_config, + &dialup_module); + if (dcfg->bytes_per_second == 0) { return DECLINED; } - core_dir_config *ccfg = ap_get_module_config(r->per_dir_config, - &core_module); - - apr_file_t *fd; + + ccfg = ap_get_module_config(r->per_dir_config, + &core_module); + rv = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY #if APR_HAS_SENDFILE @@ -180,15 +191,11 @@ dialup_handler(request_rec *r) return DECLINED; } - apr_bucket_brigade *bb; - - dialup_baton_t *db = apr_palloc(r->pool, sizeof(dialup_baton_t)); + db = apr_palloc(r->pool, sizeof(dialup_baton_t)); db->bb = apr_brigade_create(r->pool, r->connection->bucket_alloc); db->tmpbb = apr_brigade_create(r->pool, r->connection->bucket_alloc); - apr_bucket *e; - e = apr_brigade_insert_file(db->bb, fd, 0, r->finfo.size, r->pool); #if APR_HAS_MMAP @@ -293,7 +300,7 @@ static const command_rec dialup_cmds[] = AP_INIT_TAKE1("ModemStandard", cmd_modem_standard, NULL, ACCESS_CONF, "Modem Standard to.. simulate. " "Must be one of: 'V.21', 'V.26bis', 'V.32', 'V.34', or 'V.92'"), - NULL + {NULL} }; module AP_MODULE_DECLARE_DATA dialup_module =