Commit f9ace383 authored by Paul Querna's avatar Paul Querna
Browse files

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
parent 0312e463
Loading
Loading
Loading
Loading
+19 −12
Changes for modules/test/mod_dialup.c: 19 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -17,16 +17,20 @@


#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;

#ifndef apr_time_from_msec
@@ -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,
    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,

    ccfg = ap_get_module_config(r->per_dir_config,
                                &core_module);

    apr_file_t *fd;

    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 =