Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 58506 invoked from network); 6 Jan 2009 02:45:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jan 2009 02:45:49 -0000 Received: (qmail 38910 invoked by uid 500); 6 Jan 2009 02:45:48 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 38893 invoked by uid 500); 6 Jan 2009 02:45:48 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 38883 invoked by uid 99); 6 Jan 2009 02:45:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jan 2009 18:45:48 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jan 2009 02:45:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C063123888A6; Mon, 5 Jan 2009 18:45:24 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r731812 - in /httpd/httpd/trunk/server/mpm/winnt: child.c mpm_winnt.h Date: Tue, 06 Jan 2009 02:45:24 -0000 To: cvs@httpd.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090106024524.C063123888A6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wrowe Date: Mon Jan 5 18:45:24 2009 New Revision: 731812 URL: http://svn.apache.org/viewvc?rev=731812&view=rev Log: rename private COMP_CONTEXT to winnt_conn_ctx_t and make static within child.c Modified: httpd/httpd/trunk/server/mpm/winnt/child.c httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.h Modified: httpd/httpd/trunk/server/mpm/winnt/child.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/child.c?rev=731812&r1=731811&r2=731812&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/winnt/child.c (original) +++ httpd/httpd/trunk/server/mpm/winnt/child.c Mon Jan 5 18:45:24 2009 @@ -50,9 +50,31 @@ apr_proc_mutex_t *start_mutex; HANDLE exit_event; -/* Queue for managing the passing of COMP_CONTEXTs between +/* 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; + apr_socket_t *sock; + SOCKET accept_socket; + char buff[2*PADDED_ADDR_SIZE]; + struct sockaddr *sa_server; + int sa_server_len; + struct sockaddr *sa_client; + int sa_client_len; + apr_pool_t *ptrans; + apr_bucket_alloc_t *ba; + short socket_family; +} winnt_conn_ctx_t; + +typedef enum { + IOCP_CONNECTION_ACCEPTED = 1, + IOCP_WAIT_FOR_RECEIVE = 2, + IOCP_WAIT_FOR_TRANSMITFILE = 3, + IOCP_SHUTDOWN = 4 +} io_state_e; + static apr_pool_t *pchild; static int shutdown_in_progress = 0; static int workers_may_exit = 0; @@ -61,15 +83,14 @@ static apr_thread_mutex_t *child_lock; static apr_thread_mutex_t *qlock; -static PCOMP_CONTEXT qhead = NULL; -static PCOMP_CONTEXT qtail = NULL; +static winnt_conn_ctx_t *qhead = NULL; +static winnt_conn_ctx_t *qtail = NULL; static int num_completion_contexts = 0; static int max_num_completion_contexts = 0; static HANDLE ThreadDispatchIOCP = NULL; static HANDLE qwait_event = NULL; - -void mpm_recycle_completion_context(PCOMP_CONTEXT context) +static void mpm_recycle_completion_context(winnt_conn_ctx_t *context) { /* Recycle the completion context. * - clear the ptrans pool @@ -95,10 +116,10 @@ } } -PCOMP_CONTEXT mpm_get_completion_context(void) +static winnt_conn_ctx_t *mpm_get_completion_context(void) { apr_status_t rv; - PCOMP_CONTEXT context = NULL; + winnt_conn_ctx_t *context = NULL; while (1) { /* Grab a context off the queue */ @@ -149,8 +170,8 @@ apr_allocator_t *allocator; apr_thread_mutex_lock(child_lock); - context = (PCOMP_CONTEXT)apr_pcalloc(pchild, - sizeof(COMP_CONTEXT)); + context = (winnt_conn_ctx_t *)apr_pcalloc(pchild, + sizeof(winnt_conn_ctx_t)); context->Overlapped.hEvent = CreateEvent(NULL, TRUE, @@ -199,8 +220,8 @@ return context; } -apr_status_t mpm_post_completion_context(PCOMP_CONTEXT context, - io_state_e state) +static apr_status_t mpm_post_completion_context(winnt_conn_ctx_t *context, + io_state_e state) { LPOVERLAPPED pOverlapped; if (context) @@ -263,7 +284,7 @@ { ap_listen_rec *lr = (ap_listen_rec *)lr_; apr_os_sock_info_t sockinfo; - PCOMP_CONTEXT context = NULL; + winnt_conn_ctx_t *context = NULL; DWORD BytesRead; SOCKET nlsd; int rv, err_count = 0; @@ -469,7 +490,7 @@ } -static PCOMP_CONTEXT winnt_get_connection(PCOMP_CONTEXT context) +static winnt_conn_ctx_t *winnt_get_connection(winnt_conn_ctx_t *context) { int rc; DWORD BytesRead; @@ -500,7 +521,7 @@ switch (CompKey) { case IOCP_CONNECTION_ACCEPTED: - context = CONTAINING_RECORD(pol, COMP_CONTEXT, Overlapped); + context = CONTAINING_RECORD(pol, winnt_conn_ctx_t, Overlapped); break; case IOCP_SHUTDOWN: apr_atomic_dec32(&g_blocked_threads); @@ -525,7 +546,7 @@ static unsigned int __stdcall worker_main(void *thread_num_val) { static int requests_this_child = 0; - PCOMP_CONTEXT context = NULL; + winnt_conn_ctx_t *context = NULL; int thread_num = (int)thread_num_val; ap_sb_handle_t *sbh; Modified: httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.h URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.h?rev=731812&r1=731811&r2=731812&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.h (original) +++ httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.h Mon Jan 5 18:45:24 2009 @@ -100,31 +100,6 @@ #define PADDED_ADDR_SIZE (sizeof(SOCKADDR_IN)+16) #endif -typedef struct CompContext { - struct CompContext *next; - OVERLAPPED Overlapped; - apr_socket_t *sock; - SOCKET accept_socket; - char buff[2*PADDED_ADDR_SIZE]; - struct sockaddr *sa_server; - int sa_server_len; - struct sockaddr *sa_client; - int sa_client_len; - apr_pool_t *ptrans; - apr_bucket_alloc_t *ba; - short socket_family; -} COMP_CONTEXT, *PCOMP_CONTEXT; - -typedef enum { - IOCP_CONNECTION_ACCEPTED = 1, - IOCP_WAIT_FOR_RECEIVE = 2, - IOCP_WAIT_FOR_TRANSMITFILE = 3, - IOCP_SHUTDOWN = 4 -} io_state_e; - -PCOMP_CONTEXT mpm_get_completion_context(void); -void mpm_recycle_completion_context(PCOMP_CONTEXT pCompContext); -apr_status_t mpm_post_completion_context(PCOMP_CONTEXT pCompContext, io_state_e state); void hold_console_open_on_error(void); #endif /* APACHE_MPM_WINNT_H */ /** @} */