Apache HTTPD
Macros | Functions | Variables
mpm_netware.c File Reference
#include "apr.h"
#include "apr_portable.h"
#include "apr_strings.h"
#include "apr_thread_proc.h"
#include "apr_signal.h"
#include "apr_tables.h"
#include "apr_getopt.h"
#include "apr_thread_mutex.h"
#include "apr_want.h"
#include <sys/select.h>
#include "ap_config.h"
#include "httpd.h"
#include "mpm_default.h"
#include "http_main.h"
#include "http_log.h"
#include "http_config.h"
#include "http_core.h"
#include "http_connection.h"
#include "scoreboard.h"
#include "ap_mpm.h"
#include "mpm_common.h"
#include "ap_listen.h"
#include "ap_mmn.h"
#include <signal.h>
#include <netware.h>
#include <nks/netware.h>
#include <library.h>
#include <screen.h>

Go to the source code of this file.

Macros

#define APR_WANT_STDIO
 
#define APR_WANT_STRFUNC
 
#define HARD_SERVER_LIMIT   1
 
#define WORKER_DEAD   SERVER_DEAD
 
#define WORKER_STARTING   SERVER_STARTING
 
#define WORKER_READY   SERVER_READY
 
#define WORKER_IDLE_KILL   SERVER_IDLE_KILL
 
#define MPM_HARD_LIMITS_FILE   "/mpm_default.h"
 
#define HANDLEDCOMMAND   0
 
#define NOTMYCOMMAND   1
 
#define DBPRINT0(s)
 
#define DBPRINT1(s, v1)
 
#define DBPRINT2(s, v1, v2)
 
#define MAX_WB_RETRIES   3
 
#define MAX_SPAWN_RATE   (64)
 

Functions

int nlmUnloadSignaled (int wait)
 
static int InstallConsoleHandler (void)
 
static void RemoveConsoleHandler (void)
 
static int CommandLineInterpreter (scr_t screenID, const char *commandLine)
 
static void clean_child_exit (int code, int worker_num, apr_pool_t *ptrans, apr_bucket_alloc_t *bucket_alloc) __attribute__((noreturn))
 
static void mpm_main_cleanup (void)
 
static int netware_query (int query_code, int *result, apr_status_t *rv)
 
static const charnetware_get_name (void)
 
static void mpm_term (void)
 
static void sig_term (int sig)
 
static void restart (void)
 
static void set_signals (void)
 
void worker_main (void *arg)
 
static int make_child (server_rec *s, int slot)
 
static void startup_workers (int number_to_start)
 
static void perform_idle_server_maintenance (apr_pool_t *p)
 
static void display_settings ()
 
static void show_server_data ()
 
static int setup_listeners (server_rec *s)
 
static int shutdown_listeners ()
 
static int netware_run (apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 
static int netware_pre_config (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
 
static int netware_check_config (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
 
static void netware_mpm_hooks (apr_pool_t *p)
 
static void netware_rewrite_args (process_rec *process)
 
static const charset_threads_to_start (cmd_parms *cmd, void *dummy, const char *arg)
 
static const charset_min_free_threads (cmd_parms *cmd, void *dummy, const char *arg)
 
static const charset_max_free_threads (cmd_parms *cmd, void *dummy, const char *arg)
 
static const charset_thread_limit (cmd_parms *cmd, void *dummy, const char *arg)
 

Variables

static int ap_threads_per_child =0
 
static int ap_threads_to_start =0
 
static int ap_threads_min_free =0
 
static int ap_threads_max_free =0
 
static int ap_threads_limit =0
 
static int mpm_state = 0
 
static int ap_max_workers_limit = -1
 
int hold_screen_on_exit = 0
 
static fd_set listenfds
 
static int listenmaxfd
 
static apr_pool_tpconf
 
static apr_pool_tpmain
 
static pid_t ap_my_pid
 
static charap_my_addrspace = NULL
 
static int die_now = 0
 
static unsigned long worker_thread_count
 
static int request_count
 
static CommandParser_t ConsoleHandler = {0, NULL, 0}
 
static int show_settings = 0
 
static int volatile shutdown_pending
 
static int volatile restart_pending
 
static int volatile is_graceful
 
static int volatile wait_to_finish =1
 
static ap_generation_t volatile ap_my_generation =0
 
static int idle_spawn_rate = 1
 
static int hold_off_on_exponential_spawning
 
static const command_rec netware_mpm_cmds []
 
static int *const aplog_module_index = &( mpm_netware_module.module_index)
 

Macro Definition Documentation

◆ APR_WANT_STDIO

#define APR_WANT_STDIO

Definition at line 49 of file mpm_netware.c.

◆ APR_WANT_STRFUNC

#define APR_WANT_STRFUNC

Definition at line 50 of file mpm_netware.c.

◆ DBPRINT0

#define DBPRINT0 (   s)

Definition at line 163 of file mpm_netware.c.

◆ DBPRINT1

#define DBPRINT1 (   s,
  v1 
)

Definition at line 164 of file mpm_netware.c.

◆ DBPRINT2

#define DBPRINT2 (   s,
  v1,
  v2 
)

Definition at line 165 of file mpm_netware.c.

◆ HANDLEDCOMMAND

#define HANDLEDCOMMAND   0

Definition at line 151 of file mpm_netware.c.

◆ HARD_SERVER_LIMIT

#define HARD_SERVER_LIMIT   1

Definition at line 103 of file mpm_netware.c.

◆ MAX_SPAWN_RATE

#define MAX_SPAWN_RATE   (64)

Definition at line 610 of file mpm_netware.c.

◆ MAX_WB_RETRIES

#define MAX_WB_RETRIES   3

Definition at line 327 of file mpm_netware.c.

◆ MPM_HARD_LIMITS_FILE

#define MPM_HARD_LIMITS_FILE   "/mpm_default.h"

Definition at line 111 of file mpm_netware.c.

◆ NOTMYCOMMAND

#define NOTMYCOMMAND   1

Definition at line 152 of file mpm_netware.c.

◆ WORKER_DEAD

#define WORKER_DEAD   SERVER_DEAD

Definition at line 106 of file mpm_netware.c.

◆ WORKER_IDLE_KILL

#define WORKER_IDLE_KILL   SERVER_IDLE_KILL

Definition at line 109 of file mpm_netware.c.

◆ WORKER_READY

#define WORKER_READY   SERVER_READY

Definition at line 108 of file mpm_netware.c.

◆ WORKER_STARTING

#define WORKER_STARTING   SERVER_STARTING

Definition at line 107 of file mpm_netware.c.

Function Documentation

◆ clean_child_exit()

static void clean_child_exit ( int  code,
int  worker_num,
apr_pool_t ptrans,
apr_bucket_alloc_t bucket_alloc 
)
static

Definition at line 178 of file mpm_netware.c.

◆ CommandLineInterpreter()

static int CommandLineInterpreter ( scr_t  screenID,
const char commandLine 
)
static

Definition at line 1179 of file mpm_netware.c.

◆ display_settings()

static void display_settings ( )
static

Definition at line 720 of file mpm_netware.c.

◆ InstallConsoleHandler()

static int InstallConsoleHandler ( void  )
static

Definition at line 1271 of file mpm_netware.c.

◆ make_child()

static int make_child ( server_rec s,
int  slot 
)
static

Definition at line 540 of file mpm_netware.c.

◆ mpm_main_cleanup()

static void mpm_main_cleanup ( void  )
static

Definition at line 194 of file mpm_netware.c.

◆ mpm_term()

static void mpm_term ( void  )
static

Definition at line 263 of file mpm_netware.c.

◆ netware_check_config()

static int netware_check_config ( apr_pool_t p,
apr_pool_t plog,
apr_pool_t ptemp,
server_rec s 
)
static

< Module has handled this stage.

Definition at line 1011 of file mpm_netware.c.

◆ netware_get_name()

static const char * netware_get_name ( void  )
static

Definition at line 254 of file mpm_netware.c.

◆ netware_mpm_hooks()

static void netware_mpm_hooks ( apr_pool_t p)
static

Definition at line 1087 of file mpm_netware.c.

◆ netware_pre_config()

static int netware_pre_config ( apr_pool_t p,
apr_pool_t plog,
apr_pool_t ptemp 
)
static

< Module has handled this stage.

Definition at line 980 of file mpm_netware.c.

◆ netware_query()

static int netware_query ( int  query_code,
int result,
apr_status_t rv 
)
static

< This value specifies that * an MPM is using a dynamic * number of threads or daemons

< This value specifies that an * MPM is not capable of * threading or forking.

< Module has handled this stage.

Definition at line 201 of file mpm_netware.c.

◆ netware_rewrite_args()

static void netware_rewrite_args ( process_rec process)
static

Definition at line 1104 of file mpm_netware.c.

◆ netware_run()

static int netware_run ( apr_pool_t _pconf,
apr_pool_t plog,
server_rec s 
)
static

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has served the response completely * - it's safe to die() with no more output

< Module has handled this stage.

Definition at line 865 of file mpm_netware.c.

◆ nlmUnloadSignaled()

int nlmUnloadSignaled ( int  wait)

Definition at line 307 of file mpm_netware.c.

◆ perform_idle_server_maintenance()

static void perform_idle_server_maintenance ( apr_pool_t p)
static

Definition at line 614 of file mpm_netware.c.

◆ RemoveConsoleHandler()

static void RemoveConsoleHandler ( void  )
static

Definition at line 1293 of file mpm_netware.c.

◆ restart()

static void restart ( void  )
static

Definition at line 291 of file mpm_netware.c.

◆ set_max_free_threads()

static const char * set_max_free_threads ( cmd_parms cmd,
void *  dummy,
const char arg 
)
static

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 1321 of file mpm_netware.c.

◆ set_min_free_threads()

static const char * set_min_free_threads ( cmd_parms cmd,
void *  dummy,
const char arg 
)
static

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 1310 of file mpm_netware.c.

◆ set_signals()

static void set_signals ( void  )
static

Definition at line 301 of file mpm_netware.c.

◆ set_thread_limit()

static const char * set_thread_limit ( cmd_parms cmd,
void *  dummy,
const char arg 
)
static

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 1332 of file mpm_netware.c.

◆ set_threads_to_start()

static const char * set_threads_to_start ( cmd_parms cmd,
void *  dummy,
const char arg 
)
static

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 1299 of file mpm_netware.c.

◆ setup_listeners()

static int setup_listeners ( server_rec s)
static

Definition at line 827 of file mpm_netware.c.

◆ show_server_data()

static void show_server_data ( )
static

Definition at line 799 of file mpm_netware.c.

◆ shutdown_listeners()

static int shutdown_listeners ( )
static

Definition at line 850 of file mpm_netware.c.

◆ sig_term()

static void sig_term ( int  sig)
static

Definition at line 270 of file mpm_netware.c.

◆ startup_workers()

static void startup_workers ( int  number_to_start)
static

Definition at line 586 of file mpm_netware.c.

◆ worker_main()

void worker_main ( void *  arg)

< Non-blocking IO

Definition at line 336 of file mpm_netware.c.

Variable Documentation

◆ ap_max_workers_limit

int ap_max_workers_limit = -1
static

Definition at line 127 of file mpm_netware.c.

◆ ap_my_addrspace

char* ap_my_addrspace = NULL
static

Definition at line 138 of file mpm_netware.c.

◆ ap_my_generation

ap_generation_t volatile ap_my_generation =0
static

Definition at line 173 of file mpm_netware.c.

◆ ap_my_pid

pid_t ap_my_pid
static

Definition at line 137 of file mpm_netware.c.

◆ ap_threads_limit

int ap_threads_limit =0
static

Definition at line 119 of file mpm_netware.c.

◆ ap_threads_max_free

int ap_threads_max_free =0
static

Definition at line 118 of file mpm_netware.c.

◆ ap_threads_min_free

int ap_threads_min_free =0
static

Definition at line 117 of file mpm_netware.c.

◆ ap_threads_per_child

int ap_threads_per_child =0
static

Definition at line 115 of file mpm_netware.c.

◆ ap_threads_to_start

int ap_threads_to_start =0
static

Definition at line 116 of file mpm_netware.c.

◆ aplog_module_index

int* const aplog_module_index = &( mpm_netware_module.module_index)
static

Definition at line 1356 of file mpm_netware.c.

◆ ConsoleHandler

CommandParser_t ConsoleHandler = {0, NULL, 0}
static

Definition at line 150 of file mpm_netware.c.

◆ die_now

int die_now = 0
static

Definition at line 140 of file mpm_netware.c.

◆ hold_off_on_exponential_spawning

int hold_off_on_exponential_spawning
static

Definition at line 612 of file mpm_netware.c.

◆ hold_screen_on_exit

int hold_screen_on_exit = 0

Definition at line 129 of file mpm_netware.c.

◆ idle_spawn_rate

int idle_spawn_rate = 1
static

Definition at line 608 of file mpm_netware.c.

◆ is_graceful

int volatile is_graceful
static

Definition at line 171 of file mpm_netware.c.

◆ listenfds

fd_set listenfds
static

Definition at line 131 of file mpm_netware.c.

◆ listenmaxfd

int listenmaxfd
static

Definition at line 132 of file mpm_netware.c.

◆ mpm_state

int mpm_state = 0
static

Definition at line 120 of file mpm_netware.c.

◆ netware_mpm_cmds

const command_rec netware_mpm_cmds[]
static
Initial value:
= {
{ "ListenBacklog" , ap_set_listenbacklog , NULL , 128 , TAKE1, "Maximum length of the queue of pending connections, as used by listen(2)" }, { "ListenCoresBucketsRatio" , ap_set_listencbratio , NULL , 128 , TAKE1, "Ratio between the number of CPU cores (online) and the number of listeners buckets" }, { "Listen" , ap_set_listener , NULL , 128 , TAKE_ARGV, "A port number or a numeric IP address and a port number, and an optional protocol" }, { "SendBufferSize" , ap_set_send_buffer_size , NULL , 128 , TAKE1, "Send buffer size in bytes" }, { "ReceiveBufferSize" , ap_set_receive_buffer_size , NULL , 128 , TAKE1, "Receive buffer size in bytes" } ,
{ "StartThreads" , set_threads_to_start , NULL , 128 , TAKE1, "Number of worker threads launched at server startup" },
{ "MinSpareThreads" , set_min_free_threads , NULL , 128 , TAKE1, "Minimum number of idle threads, to handle request spikes" },
{ "MaxSpareThreads" , set_max_free_threads , NULL , 128 , TAKE1, "Maximum number of idle threads" },
{ "MaxThreads" , set_thread_limit , NULL , 128 , TAKE1, "Maximum number of worker threads alive at the same time" },
{ NULL }
}
@ TAKE1
Definition http_config.h:51
@ TAKE_ARGV
Definition http_config.h:66
const char * ap_set_listenbacklog(cmd_parms *cmd, void *dummy, const char *arg)
Definition listen.c:901
const char * ap_set_send_buffer_size(cmd_parms *cmd, void *dummy, const char *arg)
Definition listen.c:941
const char * ap_set_listencbratio(cmd_parms *cmd, void *dummy, const char *arg)
Definition listen.c:921
const char * ap_set_listener(cmd_parms *cmd, void *dummy, int argc, char *const argv[])
Definition listen.c:847
const char * ap_set_receive_buffer_size(cmd_parms *cmd, void *dummy, const char *arg)
Definition listen.c:960
return NULL
Definition mod_so.c:359
static const char * set_min_free_threads(cmd_parms *cmd, void *dummy, const char *arg)
static const char * set_max_free_threads(cmd_parms *cmd, void *dummy, const char *arg)
static const char * set_thread_limit(cmd_parms *cmd, void *dummy, const char *arg)
static const char * set_threads_to_start(cmd_parms *cmd, void *dummy, const char *arg)

Definition at line 1343 of file mpm_netware.c.

◆ pconf

apr_pool_t* pconf
static

Definition at line 134 of file mpm_netware.c.

◆ pmain

apr_pool_t* pmain
static

Definition at line 135 of file mpm_netware.c.

◆ request_count

int request_count
static

Definition at line 144 of file mpm_netware.c.

◆ restart_pending

int volatile restart_pending
static

Definition at line 170 of file mpm_netware.c.

◆ show_settings

int show_settings = 0
static

Definition at line 154 of file mpm_netware.c.

◆ shutdown_pending

int volatile shutdown_pending
static

Definition at line 169 of file mpm_netware.c.

◆ wait_to_finish

int volatile wait_to_finish =1
static

Definition at line 172 of file mpm_netware.c.

◆ worker_thread_count

unsigned long worker_thread_count
static

Definition at line 143 of file mpm_netware.c.