mod_dialup.c revision 5bfaaf573bacb45c1cf290ce85ecc676587e8a64
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "httpd.h"
#include "http_core.h"
#include "util_filter.h"
#include "http_log.h"
#include "http_config.h"
#include "http_request.h"
#include "http_protocol.h"
#include "ap_mpm.h"
typedef struct dialup_dcfg_t {
typedef struct dialup_baton_t {
request_rec *r;
apr_file_t *fd;
static int
{
int status;
apr_size_t bytes_sent = 0;
apr_bucket *e;
return HTTP_INTERNAL_SERVER_ERROR;
}
/* XXXXXX: Log me. */
return HTTP_INTERNAL_SERVER_ERROR;
}
apr_bucket *f;
apr_bucket *b = APR_BUCKET_PREV(e);
APR_RING_UNSPLICE(f, b, link);
}
else {
}
bytes_sent += len;
"dialup: pulse: ap_pass_brigade failed:");
return status;
}
}
return DONE;
}
else {
return SUSPENDED;
}
}
static void
dialup_callback(void *baton)
{
int status;
}
return;
}
else {
"dialup: pulse returned: %d", status);
}
}
static int
{
int status;
apr_file_t *fd;
apr_bucket *e;
/* See core.c, default handler for all of the cases we just decline. */
if (r->method_number != M_GET ||
return DECLINED;
}
if (dcfg->bytes_per_second == 0) {
return DECLINED;
}
#if APR_HAS_SENDFILE
#endif
, 0, r->pool);
if (rv) {
return DECLINED;
}
/* copied from default handler: */
ap_set_etag(r);
status = ap_meets_conditions(r);
"dialup: declined, meets conditions, good luck core handler");
return DECLINED;
}
#if APR_HAS_MMAP
apr_bucket_file_enable_mmap(e, 0);
}
#endif
db->r = r;
"dialup: failed, send pulse");
return status;
}
return SUSPENDED;
}
#ifndef APR_HOOK_ALMOST_LAST
#endif
static void
{
}
typedef struct modem_speed_t {
const char *name;
#ifndef BITRATE_TO_BYTES
#endif
static const modem_speed_t modem_bitrates[] =
{
{NULL, 0}
};
static const char *
void *dconf,
const char *input)
{
const modem_speed_t *standard;
int i = 0;
dcfg->bytes_per_second = 0;
standard = &modem_bitrates[i];
break;
}
i++;
}
if (dcfg->bytes_per_second == 0) {
return "mod_diaulup: Unkonwn Modem Standard specified.";
}
return NULL;
}
static void *
{
cfg->bytes_per_second = 0;
return cfg;
}
static const command_rec dialup_cmds[] =
{
"Modem Standard to.. simulate. "
"Must be one of: 'V.21', 'V.26bis', 'V.32', 'V.34', or 'V.92'"),
{NULL}
};
{
NULL,
NULL,
NULL,
};