apr_proc_mutex_t *start_mutex;
HANDLE exit_event;
+/*
+ * The Windoes MPM uses a queue of completion contexts that it passes
+ * between the accept threads and the worker threads. Declare the
+ * functions to access the queue and the structures passed on the
+ * queue in the header file to enable modules to access them
+ * if necessary. The queue resides in the MPM.
+ */
+#ifdef CONTAINING_RECORD
+#undef CONTAINING_RECORD
+#endif
+#define CONTAINING_RECORD(address, type, field) ((type *)( \
+ (char *)(address) - \
+ (char *)(&((type *)0)->field)))
+#if APR_HAVE_IPV6
+#define PADDED_ADDR_SIZE (sizeof(SOCKADDR_IN6)+16)
+#else
+#define PADDED_ADDR_SIZE (sizeof(SOCKADDR_IN)+16)
+#endif
+
/* Queue for managing the passing of winnt_conn_ctx_t between
* the accept and worker threads.
*/
typedef struct winnt_conn_ctx_t_s {
struct winnt_conn_ctx_t_s *next;
- OVERLAPPED Overlapped;
+ OVERLAPPED overlapped;
apr_socket_t *sock;
SOCKET accept_socket;
char buff[2*PADDED_ADDR_SIZE];
apr_pool_clear(context->ptrans);
context->ba = apr_bucket_alloc_create(context->ptrans);
context->next = NULL;
- ResetEvent(context->Overlapped.hEvent);
+ ResetEvent(context->overlapped.hEvent);
apr_thread_mutex_lock(qlock);
if (qtail) {
qtail->next = context;
sizeof(winnt_conn_ctx_t));
- context->Overlapped.hEvent = CreateEvent(NULL, TRUE,
+ context->overlapped.hEvent = CreateEvent(NULL, TRUE,
FALSE, NULL);
- if (context->Overlapped.hEvent == NULL) {
+ if (context->overlapped.hEvent == NULL) {
/* Hopefully this is a temporary condition ... */
ap_log_error(APLOG_MARK, APLOG_WARNING, apr_get_os_error(),
ap_server_conf,
ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf,
"mpm_get_completion_context: Failed "
"to create the transaction pool.");
- CloseHandle(context->Overlapped.hEvent);
+ CloseHandle(context->overlapped.hEvent);
apr_thread_mutex_unlock(child_lock);
return NULL;
{
LPOVERLAPPED pOverlapped;
if (context)
- pOverlapped = &context->Overlapped;
+ pOverlapped = &context->overlapped;
else
pOverlapped = NULL;
PADDED_ADDR_SIZE,
PADDED_ADDR_SIZE,
&BytesRead,
- &context->Overlapped)) {
+ &context->overlapped)) {
rv = apr_get_netos_error();
if ((rv == APR_FROM_OS_ERROR(WSAEINVAL)) ||
(rv == APR_FROM_OS_ERROR(WSAENOTSOCK))) {
* XXX: We should be waiting on exit_event instead of polling
*/
while (1) {
- rv = WaitForSingleObject(context->Overlapped.hEvent, 1000);
+ rv = WaitForSingleObject(context->overlapped.hEvent, 1000);
if (rv == WAIT_OBJECT_0) {
if (context->accept_socket == INVALID_SOCKET) {
/* socket already closed */
break;
}
if (!GetOverlappedResult((HANDLE)context->accept_socket,
- &context->Overlapped,
+ &context->overlapped,
&BytesRead, FALSE)) {
ap_log_error(APLOG_MARK, APLOG_WARNING,
apr_get_os_error(), ap_server_conf,
*/
PostQueuedCompletionStatus(ThreadDispatchIOCP, 0,
IOCP_CONNECTION_ACCEPTED,
- &context->Overlapped);
+ &context->overlapped);
context = NULL;
}
if (!shutdown_in_progress) {
switch (CompKey) {
case IOCP_CONNECTION_ACCEPTED:
- context = CONTAINING_RECORD(pol, winnt_conn_ctx_t, Overlapped);
+ context = CONTAINING_RECORD(pol, winnt_conn_ctx_t, overlapped);
break;
case IOCP_SHUTDOWN:
apr_atomic_dec32(&g_blocked_threads);
/* Empty the accept queue of completion contexts */
apr_thread_mutex_lock(qlock);
while (qhead) {
- CloseHandle(qhead->Overlapped.hEvent);
+ CloseHandle(qhead->overlapped.hEvent);
closesocket(qhead->accept_socket);
qhead = qhead->next;
}
} ap_signal_parent_e;
AP_DECLARE(void) ap_signal_parent(ap_signal_parent_e type);
-/*
- * The Windoes MPM uses a queue of completion contexts that it passes
- * between the accept threads and the worker threads. Declare the
- * functions to access the queue and the structures passed on the
- * queue in the header file to enable modules to access them
- * if necessary. The queue resides in the MPM.
- */
-#ifdef CONTAINING_RECORD
-#undef CONTAINING_RECORD
-#endif
-#define CONTAINING_RECORD(address, type, field) ((type *)( \
- (PCHAR)(address) - \
- (PCHAR)(&((type *)0)->field)))
-#if APR_HAVE_IPV6
-#define PADDED_ADDR_SIZE (sizeof(SOCKADDR_IN6)+16)
-#else
-#define PADDED_ADDR_SIZE (sizeof(SOCKADDR_IN)+16)
-#endif
-
void hold_console_open_on_error(void);
#endif /* APACHE_MPM_WINNT_H */
/** @} */