38#include "mpm_default.h"
50#define WSAID_ACCEPTEX \
51 {0xb5367df1, 0xcbac, 0x11cf, {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
55#ifndef WSAID_GETACCEPTEXSOCKADDRS
56#define WSAID_GETACCEPTEXSOCKADDRS \
57 {0xb5367df2, 0xcbac, 0x11cf, {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
72#ifdef CONTAINING_RECORD
73#undef CONTAINING_RECORD
75#define CONTAINING_RECORD(address, type, field) ((type *)( \
77 (char *)(&((type *)0)->field)))
79#define PADDED_ADDR_SIZE (sizeof(SOCKADDR_IN6)+16)
81#define PADDED_ADDR_SIZE (sizeof(SOCKADDR_IN)+16)
192 "Server ran out of threads to serve "
193 "requests. Consider raising the "
194 "ThreadsPerChild setting");
210 "mpm_get_completion_context: Failed to get a "
211 "free context within 1 second");
218 "mpm_get_completion_context: "
219 "WaitForSingleObject failed to get free context");
242 "mpm_get_completion_context: "
243 "CreateEvent failed.");
256 "mpm_get_completion_context: Failed "
257 "to create the transaction pool.");
308 APLOGNO(02531)
"winnt_accept: Listen protocol '%s' has "
309 "no known accept filter. Using 'none' instead",
315 APLOGNO(03458)
"winnt_accept: 'data' accept filter is no "
316 "longer supported. Using 'connect' instead");
327 "winnt_accept: unrecognized AcceptFilter '%s', "
328 "only 'data', 'connect' or 'none' are valid. "
329 "Using 'none' instead",
name);
348#define MAX_ACCEPTEX_ERR_COUNT 10
377 "winnt_accept: getsockname error on listening socket, "
378 "is IPv6 available?");
392 "winnt_accept: failed to retrieve AcceptEx, try 'AcceptFilter none'");
401 "winnt_accept: failed to retrieve GetAcceptExSockaddrs, try 'AcceptFilter none'");
424 "WSAEventSelect() failed.");
431 "Child: Accept thread listening on %pI using AcceptFilter %s",
445 "winnt_accept: Too many failures grabbing a "
446 "connection ctx. Aborting.");
480 "winnt_accept: Failed to allocate an accept socket. "
481 "Temporary resource constraint? Try again.");
520 "Child: Encountered too many AcceptEx "
521 "faults accepting client connections. "
522 "Possible causes: dynamic address renewal, "
523 "or incompatible VPN or firewall software. ");
525 "winnt_mpm: falling back to "
526 "'AcceptFilter none'.");
539 "Child: Encountered too many AcceptEx "
540 "faults accepting client connections.");
542 "winnt_mpm: falling back to "
543 "'AcceptFilter none'.");
552 events[0] =
context->overlapped.hEvent;
565 "winnt_accept: Asynchronous AcceptEx failed.");
593 "setsockopt(SO_UPDATE_ACCEPT_CONTEXT) failed.");
646 "accept() failed, retrying.");
662 "Child: Encountered too many accept() "
663 "resource faults, aborting.");
682 "getsockname failed");
688 "getpeername failed");
728 "Child: Accept thread exiting.");
757 "Child: GetQueuedCompletionStatus returned %d",
796#if AP_HAS_THREAD_LOCAL
799 "Couldn't initialize worker thread, thread locals won't "
829 context->sock, thread_num, sbh,
842 c->current_thread =
thd;
856#if AP_HAS_THREAD_LOCAL
950 "Child: Failed to create a max_requests event.");
961 "Child: Failed to open handle to parent process %ld; "
962 "will not react to abrupt parent termination",
parent_pid);
982 "Child: Failed to acquire the start_mutex. "
983 "Process will exit.");
987 "Child: Acquired the start mutex.");
1000 "Child: Failed to create a qwait event.");
1028 "Child: CreateThread failed. Unable to "
1029 "create all worker threads. Created %d of the %d "
1030 "threads requested with the ThreadsPerChild "
1031 "configuration directive.",
1091#if !APR_HAS_OTHER_CHILD
1107 "Child: WAIT_FAILED -- shutting down server");
1115 "Child: Event handle #%d (%pp) is invalid",
1121 else if (
cld == 0) {
1124 "Child: Exit event signaled. Child process is "
1128 else if (
cld == 2) {
1131 "Child: Parent process exited abruptly. Child process "
1140 "Child: Process exiting because it reached "
1141 "MaxConnectionsPerChild. Signaling the parent to "
1142 "restart a new child process.");
1181 "Child: Released the start mutex");
1185 "Child: Failure releasing the start mutex");
1193 "Child: %d threads blocked on the completion port",
1234 "Child: Waiting %d more seconds "
1235 "for %d worker threads to finish.",
1278 "Child: Terminating %d threads that failed to exit.",
1292 "Child: All worker threads have exited.");
Symbol export macros and hook functions.
Apache Listeners Library.
Apache Multi-Processing Module library.
APR-UTIL Buckets/Bucket Brigades.
#define WaitForMultipleObjects(d1, ah, b, d2)
#define _beginthreadex(sd, d1, fn, pv, d2, pd3)
#define CreateThread(sd, d1, fn, pv, d2, pd3)
#define WaitForMultipleObjectsEx(d1, ah, b1, d2, b2)
#define CreateIoCompletionPort(h1, h2, pd1, d2)
#define WaitForSingleObject(h, d)
APR Command Arguments (getopt)
APR general purpose library routines.
APR Portability Routines.
APR Shared Memory Routines.
APR Thread Mutex Routines.
APR Thread and Process Library.
apr_uint32_t apr_atomic_inc32(volatile apr_uint32_t *mem)
int apr_atomic_dec32(volatile apr_uint32_t *mem)
void ap_process_connection(conn_rec *c, void *csd)
void ap_lingering_close(conn_rec *c)
conn_rec * ap_run_create_connection(apr_pool_t *p, server_rec *server, apr_socket_t *csd, long conn_id, void *sbh, apr_bucket_alloc_t *alloc)
static apr_pool_t * pconf
static void child_main(int child_num_arg, int child_bucket)
static volatile int workers_may_exit
static void create_listener_thread(thread_starter *ts)
#define APLOG_USE_MODULE(foo)
void ap_run_child_init(apr_pool_t *pchild, server_rec *s)
#define ap_get_core_module_config(v)
ap_listen_rec * ap_listeners
server_rec * ap_server_conf
const unsigned char * buf
void ap_signal_parent(ap_signal_parent_e type)
apr_proc_mutex_t * start_mutex
int ap_max_requests_per_child
apr_size_t ap_thread_stacksize
apr_uint32_t ap_max_mem_free
#define APR_OC_REASON_RUNNING
#define APR_FROM_OS_ERROR(e)
#define apr_get_netos_error()
#define apr_get_os_error()
apr_vformatter_buff_t * c
apr_sockaddr_t * sockaddr
apr_abortfunc_t apr_allocator_t * allocator
#define apr_pool_create(newpool, parent)
#define apr_pcalloc(p, size)
#define APR_SO_DISCONNECTED
static apr_pool_t * pchild
Apache connection library.
Multi-Processing Modules functions.
static int ap_threads_per_child
static void worker_main(void *vpArg)
apr_os_thread_t apr_os_thread_current()
static int requests_this_child
Apache scoreboard library.
void ap_create_sb_handle(ap_sb_handle_t **new_sbh, apr_pool_t *p, int child_num, int thread_num)
scoreboard * ap_scoreboard_image
int ap_update_child_status_from_indexes(int child_num, int thread_num, int status, request_rec *r)
Apache's listeners record.
Structure to store things which are per connection.
apr_interval_time_t timeout
struct ap_conf_vector_t * module_config
apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock)
apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont)
apr_status_t apr_socket_close(apr_socket_t *thesocket)
apr_status_t apr_socket_opt_get(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on)
typedef int(WSAAPI *apr_winapi_fpt_WSAPoll)(IN OUT LPWSAPOLLFD fdArray
typedef HANDLE(WINAPI *apr_winapi_fpt_CreateToolhelp32Snapshot)(DWORD dwFlags
typedef DWORD(WINAPI *apr_winapi_fpt_GetCompressedFileSizeA)(IN LPCSTR lpFileName