Commit 7b9cc3ab authored by Bill Stoddard's avatar Bill Stoddard
Browse files

*) Reimplement the Windows MPM (mpm_winnt.c) to eliminate calling

     DuplicateHandle on an IOCompletionPort (a practice which
     MS "discourages"). The new model does not rely on associating
     the completion port with the listening sockets, thus the
     completion port can be completely managed within the child
     process.  A dedicated thread accepts connections off the network,
     then calls PostQueuedCompletionStatus() to wake up worker
     threads blocked on the completion port.
     [Bill Stoddard]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88498 13f79535-47bb-0310-9956-ffa450edef68
parent 34cf4dd1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
Changes with Apache 2.0.15-dev
  *) Reimplement the Windows MPM (mpm_winnt.c) to eliminate calling 
     DuplicateHandle on an IOCompletionPort (a practice which
     MS "discourages"). The new model does not rely on associating
     the completion port with the listening sockets, thus the
     completion port can be completely managed within the child 
     process.  A dedicated thread accepts connections off the network,
     then calls PostQueuedCompletionStatus() to wake up worker
     threads blocked on the completion port.
     [Bill Stoddard]

  *) Bring forward the --suexec-umask option which allows the
     builder to preset the umask for suexec processes.  [Ken Coar]
+2 −9
Original line number Diff line number Diff line
@@ -87,13 +87,6 @@ struct ap_listen_rec {
     * Is this socket currently active 
     */
    int active;
#ifdef WIN32
    /**
     * Windows only.  The number of completion ports currently listening to 
     * this socket 
     */
    int count;
#endif
/* more stuff here, like which protocol is bound to the port */
};

@@ -106,7 +99,7 @@ extern ap_listen_rec *ap_listeners;
 * Setup all of the defaults for the listener list
 */
void ap_listen_pre_config(void);
#if !defined(WIN32) && !defined(SPMT_OS2_MPM)
#if !defined(SPMT_OS2_MPM)
/**
 * Loop through the global ap_listen_rec list and create all of the required
 * sockets.  This executes the listen and bind on the sockets.
@@ -119,7 +112,7 @@ int ap_setup_listeners(server_rec *s);
#endif
/* Split into two #if's to make the exports scripts easier.
 */
#if defined(WIN32) || defined(SPMT_OS2_MPM)
#if defined(SPMT_OS2_MPM)
/**
 * Create and open a socket on the specified port.  This includes listening
 * and binding the socket.
+1 −3
Original line number Diff line number Diff line
@@ -257,7 +257,7 @@ static void alloc_listener(process_rec *process, char *addr, apr_port_t port)
    ap_listeners = new;
}

#if !defined(WIN32) && !defined(SPMT_OS2_MPM)
#if !defined(SPMT_OS2_MPM)
static
#endif
int ap_listen_open(process_rec *process, apr_port_t port)
@@ -299,7 +299,6 @@ int ap_listen_open(process_rec *process, apr_port_t port)
    return num_open ? 0 : -1;
}

#if !defined(WIN32)
int ap_setup_listeners(server_rec *s)
{
    ap_listen_rec *lr;
@@ -312,7 +311,6 @@ int ap_setup_listeners(server_rec *s)
    }
    return num_listeners;
}
#endif

void ap_listen_pre_config(void)
{
+330 −546

File changed.

Preview size limit exceeded, changes collapsed.

+0 −13
Original line number Diff line number Diff line
@@ -123,19 +123,6 @@ AP_DECLARE(void) ap_start_restart(int gracefully);
void setup_signal_names(char *prefix);
void signal_parent(int type);

typedef struct CompContext {
    OVERLAPPED Overlapped;
    SOCKET accept_socket;
    apr_socket_t *sock;
    ap_listen_rec *lr;
    char *recv_buf;
    int  recv_buf_size;
    apr_pool_t *ptrans;
    struct sockaddr *sa_server;
    int sa_server_len;
    struct sockaddr *sa_client;
    int sa_client_len;
} COMP_CONTEXT, *PCOMP_CONTEXT;

/* This code is stolen from the apr_private.h and misc/win32/misc.c
 * Please see those sources for detailed documentation.