simple_api.c revision ff32c2e8bb4918d83fdad1182dcc26eeb88d28a5
/* 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 "ap_mpm.h"
#include "httpd.h"
#include "http_config.h"
#include "mpm_common.h"
#include "http_log.h"
#include "scoreboard.h"
#include "ap_listen.h"
#include "simple_types.h"
#include "simple_run.h"
#include "http_core.h"
/* This file contains the absolute minimal MPM API, to interface with httpd. */
{
return DONE;
}
return simple_main_loop(sc);
}
{
*rv = APR_SUCCESS;
switch (query_code) {
case AP_MPMQ_IS_THREADED:
*result = AP_MPMQ_STATIC;
break;
case AP_MPMQ_IS_FORKED:
break;
case AP_MPMQ_IS_ASYNC:
*result = 1;
break;
case AP_MPMQ_MAX_DAEMON_USED:
break;
break;
break;
case AP_MPMQ_MAX_THREADS:
break;
break;
break;
break;
break;
case AP_MPMQ_MAX_DAEMONS:
break;
case AP_MPMQ_MPM_STATE:
break;
case AP_MPMQ_GENERATION:
*result = 0;
break;
default:
*rv = APR_ENOTIMPL;
break;
}
return OK;
}
static const char *
simple_get_name(void)
{
return "simple";
}
static int
{
int nsock;
nsock = ap_setup_listeners(s);
if (nsock < 1) {
s,
"simple_open_logs: no listening sockets available, shutting down");
return DONE;
}
return OK;
}
static int
{
int run_debug;
/* this is our first 'real' entry point, so setup everything here. */
rv = simple_core_init_once();
if (rv) {
"simple_core_init_once: Fatal Error Encountered");
return HTTP_INTERNAL_SERVER_ERROR;
}
sc = simple_core_get();
sc->restart_num++;
if (run_debug) {
}
else {
}
if (sc->run_foreground) {
}
else {
}
if (rv) {
"simple_pre_config: apr_proc_detach(%s) failed",
return HTTP_INTERNAL_SERVER_ERROR;
}
}
return OK;
}
static int
{
"simple_check_config: SimpleProcCount must be at most %d",
return !OK;
}
"simple_check_config: SimpleProcCount must be at least %d",
return !OK;
}
"simple_check_config: SimpleThreadCount must be at most %d",
return !OK;
}
"simple_check_config: SimpleThreadCount must be at least %d",
return !OK;
}
return OK;
}
static void simple_hooks(apr_pool_t * p)
{
}
const char *arg)
{
return err;
}
return NULL;
}
const char *arg)
{
return err;
}
return NULL;
}
static const command_rec simple_cmds[] = {
"Number of child processes launched at server startup"),
"Set the number of Worker Threads Per-Process"),
/* pqXXXXXXXXX: These do NOT belong in the MPM configuration commands. */
{NULL}
};
NULL, /* hook to run before apache parses args */
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
simple_cmds, /* command apr_table_t */
simple_hooks /* register_hooks */
};