Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 163B111AEC for ; Wed, 25 Jun 2014 10:42:57 +0000 (UTC) Received: (qmail 72135 invoked by uid 500); 25 Jun 2014 10:42:57 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 72068 invoked by uid 500); 25 Jun 2014 10:42:56 -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 72059 invoked by uid 99); 25 Jun 2014 10:42:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2014 10:42:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Wed, 25 Jun 2014 10:42:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9B3E6238888F; Wed, 25 Jun 2014 10:42:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1605328 - /httpd/httpd/trunk/server/mpm/event/event.c Date: Wed, 25 Jun 2014 10:42:32 -0000 To: cvs@httpd.apache.org From: takashi@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140625104232.9B3E6238888F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: takashi Date: Wed Jun 25 10:42:32 2014 New Revision: 1605328 URL: http://svn.apache.org/r1605328 Log: event: minify local variables scope. Modified: httpd/httpd/trunk/server/mpm/event/event.c Modified: httpd/httpd/trunk/server/mpm/event/event.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1605328&r1=1605327&r2=1605328&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/event/event.c (original) +++ httpd/httpd/trunk/server/mpm/event/event.c Wed Jun 25 10:42:32 2014 @@ -1655,21 +1655,11 @@ static void socket_callback_wrapper(void static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) { - timer_event_t *te; apr_status_t rc; proc_info *ti = dummy; int process_slot = ti->pid; apr_pool_t *tpool = apr_thread_pool_get(thd); - void *csd = NULL; - apr_pool_t *ptrans; /* Pool for per-transaction stuff */ - ap_listen_rec *lr; - int have_idle_worker = 0; - event_conn_state_t *cs; - const apr_pollfd_t *out_pfd; - apr_int32_t num = 0; - apr_interval_time_t timeout_interval; - apr_time_t timeout_time = 0, now, last_log; - listener_poll_type *pt; + apr_time_t timeout_time = 0, last_log; int closed = 0, listeners_disabled = 0; last_log = apr_time_now(); @@ -1699,7 +1689,13 @@ static void * APR_THREAD_FUNC listener_t apr_signal(LISTENER_SIGNAL, dummy_signal_handler); for (;;) { + timer_event_t *te; + const apr_pollfd_t *out_pfd; + apr_int32_t num = 0; + apr_interval_time_t timeout_interval; + apr_time_t now; int workers_were_busy = 0; + int have_idle_worker = 0; if (listener_may_exit) { close_listeners(process_slot, &closed); if (terminate_mode == ST_UNGRACEFUL @@ -1794,12 +1790,12 @@ static void * APR_THREAD_FUNC listener_t } while (num) { - pt = (listener_poll_type *) out_pfd->client_data; + listener_poll_type *pt = (listener_poll_type *) out_pfd->client_data; if (pt->type == PT_CSD) { /* one of the sockets is readable */ struct timeout_queue *remove_from_q = &write_completion_q; int blocking = 1; - cs = (event_conn_state_t *) pt->baton; + event_conn_state_t *cs = (event_conn_state_t *) pt->baton; switch (cs->pub.state) { case CONN_STATE_CHECK_REQUEST_LINE_READABLE: cs->pub.state = CONN_STATE_READ_REQUEST_LINE; @@ -1891,7 +1887,9 @@ static void * APR_THREAD_FUNC listener_t enable_listensocks(process_slot); } if (!listeners_disabled) { - lr = (ap_listen_rec *) pt->baton; + void *csd = NULL; + ap_listen_rec *lr = (ap_listen_rec *) pt->baton; + apr_pool_t *ptrans; /* Pool for per-transaction stuff */ ap_pop_pool(&ptrans, worker_queue_info); if (ptrans == NULL) { @@ -2070,12 +2068,8 @@ static void *APR_THREAD_FUNC worker_thre proc_info *ti = dummy; int process_slot = ti->pid; int thread_slot = ti->tid; - apr_socket_t *csd = NULL; - event_conn_state_t *cs; - apr_pool_t *ptrans; /* Pool for per-transaction stuff */ apr_status_t rv; int is_idle = 0; - timer_event_t *te = NULL; free(ti); @@ -2086,6 +2080,11 @@ static void *APR_THREAD_FUNC worker_thre SERVER_STARTING, NULL); while (!workers_may_exit) { + apr_socket_t *csd = NULL; + event_conn_state_t *cs; + timer_event_t *te = NULL; + apr_pool_t *ptrans; /* Pool for per-transaction stuff */ + if (!is_idle) { rv = ap_queue_info_set_idle(worker_queue_info, NULL); if (rv != APR_SUCCESS) { @@ -2105,7 +2104,6 @@ static void *APR_THREAD_FUNC worker_thre break; } - te = NULL; rv = ap_queue_pop_something(worker_queue, &csd, &cs, &ptrans, &te); if (rv != APR_SUCCESS) {