You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2010/08/04 00:12:20 UTC

svn commit: r982050 - in /httpd/httpd/trunk: modules/generators/ modules/slotmem/ modules/ssl/ server/ server/mpm/event/ server/mpm/netware/ server/mpm/prefork/

Author: sf
Date: Tue Aug  3 22:12:19 2010
New Revision: 982050

URL: http://svn.apache.org/viewvc?rev=982050&view=rev
Log:
remove more unused variables
revove some obsolete comments

netware file is untested

Modified:
    httpd/httpd/trunk/modules/generators/mod_cgid.c
    httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
    httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
    httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c
    httpd/httpd/trunk/modules/ssl/ssl_engine_rand.c
    httpd/httpd/trunk/server/mpm/event/event.c
    httpd/httpd/trunk/server/mpm/event/fdqueue.c
    httpd/httpd/trunk/server/mpm/netware/mpm_netware.c
    httpd/httpd/trunk/server/mpm/prefork/prefork.c
    httpd/httpd/trunk/server/mpm_common.c
    httpd/httpd/trunk/server/mpm_unix.c
    httpd/httpd/trunk/server/request.c
    httpd/httpd/trunk/server/util_ebcdic.c

Modified: httpd/httpd/trunk/modules/generators/mod_cgid.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_cgid.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_cgid.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_cgid.c Tue Aug  3 22:12:19 2010
@@ -357,14 +357,12 @@ static apr_status_t sock_writev(int fd, 
     int rc;
     struct iovec *vec;
     int i;
-    int total_bytes = 0;
 
     vec = (struct iovec *)apr_palloc(r->pool, count * sizeof(struct iovec));
     va_start(ap, count);
     for (i = 0; i < count; i++) {
         vec[i].iov_base = va_arg(ap, caddr_t);
         vec[i].iov_len  = va_arg(ap, apr_size_t);
-        total_bytes += vec[i].iov_len;
     }
     va_end(ap);
 

Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original)
+++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Tue Aug  3 22:12:19 2010
@@ -184,7 +184,6 @@ static void restore_slotmem(void *ptr, c
 static apr_status_t cleanup_slotmem(void *param)
 {
     ap_slotmem_instance_t **mem = param;
-    apr_status_t rv;
     apr_pool_t *pool = NULL;
 
     if (*mem) {
@@ -192,7 +191,7 @@ static apr_status_t cleanup_slotmem(void
         pool = next->gpool;
         while (next) {
             store_slotmem(next);
-            rv = apr_shm_destroy((apr_shm_t *)next->shm);
+            apr_shm_destroy((apr_shm_t *)next->shm);
             next = next->next;
         }
         apr_pool_destroy(pool);

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_io.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_io.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_io.c Tue Aug  3 22:12:19 2010
@@ -1839,14 +1839,12 @@ long ssl_io_data_cb(BIO *bio, int cmd,
     SSL *ssl;
     conn_rec *c;
     server_rec *s;
-    SSLSrvConfigRec *sc;
 
     if ((ssl = (SSL *)BIO_get_callback_arg(bio)) == NULL)
         return rc;
     if ((c = (conn_rec *)SSL_get_app_data(ssl)) == NULL)
         return rc;
     s = mySrvFromConn(c);
-    sc = mySrvConfig(s);
 
     if (   cmd == (BIO_CB_WRITE|BIO_CB_RETURN)
         || cmd == (BIO_CB_READ |BIO_CB_RETURN) ) {

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c Tue Aug  3 22:12:19 2010
@@ -159,7 +159,6 @@ void ssl_pphrase_Handle(server_rec *s, a
     char *an;
     char *cp;
     apr_time_t pkey_mtime = 0;
-    int isterm = 1;
     apr_status_t rv;
     /*
      * Start with a fresh pass phrase array
@@ -419,7 +418,7 @@ void ssl_pphrase_Handle(server_rec *s, a
                  */
                 if (cpPassPhraseCur == NULL) {
                     if (nPassPhraseDialogCur && pkey_mtime &&
-                        !(isterm = isatty(fileno(stdout)))) /* XXX: apr_isatty() */
+                        !isatty(fileno(stdout))) /* XXX: apr_isatty() */
                     {
                         ap_log_error(APLOG_MARK, APLOG_ERR, 0,
                                      pServ,

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_rand.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_rand.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_rand.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_rand.c Tue Aug  3 22:12:19 2010
@@ -45,19 +45,17 @@ int ssl_rand_seed(server_rec *s, apr_poo
     ssl_randseed_t *pRandSeeds;
     ssl_randseed_t *pRandSeed;
     unsigned char stackdata[256];
-    int nReq, nDone;
+    int nDone;
     apr_file_t *fp;
     int i, n, l;
 
     mc = myModConfig(s);
-    nReq  = 0;
     nDone = 0;
     apRandSeed = mc->aRandSeed;
     pRandSeeds = (ssl_randseed_t *)apRandSeed->elts;
     for (i = 0; i < apRandSeed->nelts; i++) {
         pRandSeed = &pRandSeeds[i];
         if (pRandSeed->nCtx == nCtx) {
-            nReq += pRandSeed->nBytes;
             if (pRandSeed->nSrc == SSL_RSSRC_FILE) {
                 /*
                  * seed in contents of an external file

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Tue Aug  3 22:12:19 2010
@@ -1155,7 +1155,6 @@ static void * APR_THREAD_FUNC listener_t
                                  ap_server_conf,
                                  "event_loop: unexpected state %d",
                                  cs->state);
-                    AP_DEBUG_ASSERT(0);
                 }
 
                 apr_thread_mutex_lock(timeout_mutex);

Modified: httpd/httpd/trunk/server/mpm/event/fdqueue.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/fdqueue.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/fdqueue.c (original)
+++ httpd/httpd/trunk/server/mpm/event/fdqueue.c Tue Aug  3 22:12:19 2010
@@ -165,7 +165,6 @@ apr_status_t ap_queue_info_wait_for_idle
                                       queue_info->idlers_mutex);
             if (rv != APR_SUCCESS) {
                 apr_status_t rv2;
-                AP_DEBUG_ASSERT(0);
                 rv2 = apr_thread_mutex_unlock(queue_info->idlers_mutex);
                 if (rv2 != APR_SUCCESS) {
                     return rv2;

Modified: httpd/httpd/trunk/server/mpm/netware/mpm_netware.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/netware/mpm_netware.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/netware/mpm_netware.c (original)
+++ httpd/httpd/trunk/server/mpm/netware/mpm_netware.c Tue Aug  3 22:12:19 2010
@@ -345,7 +345,6 @@ void worker_main(void *arg)
 {
     ap_listen_rec *lr, *first_lr, *last_lr = NULL;
     apr_pool_t *ptrans;
-    apr_pool_t *pbucket;
     apr_allocator_t *allocator;
     apr_bucket_alloc_t *bucket_alloc;
     conn_rec *current_conn;
@@ -617,7 +616,6 @@ static int hold_off_on_exponential_spawn
 static void perform_idle_server_maintenance(apr_pool_t *p)
 {
     int i;
-    int to_kill;
     int idle_count;
     worker_score *ws;
     int free_length;
@@ -628,7 +626,6 @@ static void perform_idle_server_maintena
     /* initialize the free_list */
     free_length = 0;
 
-    to_kill = -1;
     idle_count = 0;
     last_non_dead = -1;
     total_non_dead = 0;
@@ -660,13 +657,6 @@ static void perform_idle_server_maintena
             */
             if (status <= WORKER_READY) {
                 ++ idle_count;
-                /* always kill the highest numbered child if we have to...
-                * no really well thought out reason ... other than observing
-                * the server behaviour under linux where lower numbered children
-                * tend to service more hits (and hence are more likely to have
-                * their data in cpu caches).
-                */
-                to_kill = i;
             }
 
             ++total_non_dead;
@@ -978,13 +968,10 @@ static int netware_run(apr_pool_t *_pcon
 
 static int netware_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
 {
-    int debug;
     char *addrname = NULL;
 
     mpm_state = AP_MPMQ_STARTING;
 
-    debug = ap_exists_config_define("DEBUG");
-
     is_graceful = 0;
     ap_my_pid = getpid();
     addrname = getaddressspacename (NULL, NULL);

Modified: httpd/httpd/trunk/server/mpm/prefork/prefork.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/prefork/prefork.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/prefork/prefork.c (original)
+++ httpd/httpd/trunk/server/mpm/prefork/prefork.c Tue Aug  3 22:12:19 2010
@@ -800,7 +800,6 @@ static int hold_off_on_exponential_spawn
 static void perform_idle_server_maintenance(apr_pool_t *p)
 {
     int i;
-    int to_kill;
     int idle_count;
     worker_score *ws;
     int free_length;
@@ -811,7 +810,6 @@ static void perform_idle_server_maintena
     /* initialize the free_list */
     free_length = 0;
 
-    to_kill = -1;
     idle_count = 0;
     last_non_dead = -1;
     total_non_dead = 0;
@@ -839,13 +837,6 @@ static void perform_idle_server_maintena
              */
             if (status <= SERVER_READY) {
                 ++ idle_count;
-                /* always kill the highest numbered child if we have to...
-                 * no really well thought out reason ... other than observing
-                 * the server behaviour under linux where lower numbered children
-                 * tend to service more hits (and hence are more likely to have
-                 * their data in cpu caches).
-                 */
-                to_kill = i;
             }
 
             ++total_non_dead;

Modified: httpd/httpd/trunk/server/mpm_common.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm_common.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm_common.c (original)
+++ httpd/httpd/trunk/server/mpm_common.c Tue Aug  3 22:12:19 2010
@@ -264,7 +264,6 @@ int ap_coredumpdir_configured;
 const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
                                    const char *arg)
 {
-    apr_status_t rv;
     apr_finfo_t finfo;
     const char *fname;
     const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
@@ -277,7 +276,7 @@ const char *ap_mpm_set_coredumpdir(cmd_p
         return apr_pstrcat(cmd->pool, "Invalid CoreDumpDirectory path ",
                            arg, NULL);
     }
-    if ((rv = apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool)) != APR_SUCCESS) {
+    if (apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool) != APR_SUCCESS) {
         return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
                            " does not exist", NULL);
     }

Modified: httpd/httpd/trunk/server/mpm_unix.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm_unix.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm_unix.c (original)
+++ httpd/httpd/trunk/server/mpm_unix.c Tue Aug  3 22:12:19 2010
@@ -626,7 +626,6 @@ int ap_signal_server(int *exit_status, a
     apr_status_t rv;
     pid_t otherpid;
     int running = 0;
-    int have_pid_file = 0;
     const char *status;
 
     *exit_status = 0;
@@ -644,7 +643,6 @@ int ap_signal_server(int *exit_status, a
         status = "httpd (no pid file) not running";
     }
     else {
-        have_pid_file = 1;
         if (kill(otherpid, 0) == 0) {
             running = 1;
             status = apr_psprintf(pconf,
@@ -715,12 +713,10 @@ void ap_mpm_rewrite_args(process_rec *pr
     apr_getopt_t *opt;
     char optbuf[3];
     const char *optarg;
-    int fixed_args;
 
     mpm_new_argv = apr_array_make(process->pool, process->argc,
                                   sizeof(const char **));
     *(const char **)apr_array_push(mpm_new_argv) = process->argv[0];
-    fixed_args = mpm_new_argv->nelts;
     apr_getopt_init(&opt, process->pool, process->argc, process->argv);
     opt->errfn = NULL;
     optbuf[0] = '-';

Modified: httpd/httpd/trunk/server/request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/request.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/server/request.c (original)
+++ httpd/httpd/trunk/server/request.c Tue Aug  3 22:12:19 2010
@@ -398,7 +398,6 @@ static walk_cache_t *prep_walk_cache(apr
 static int resolve_symlink(char *d, apr_finfo_t *lfi, int opts, apr_pool_t *p)
 {
     apr_finfo_t fi;
-    int res;
     const char *savename;
 
     if (!(opts & (OPT_SYM_OWNER | OPT_SYM_LINKS))) {
@@ -410,9 +409,9 @@ static int resolve_symlink(char *d, apr_
 
     /* if OPT_SYM_OWNER is unset, we only need to check target accessible */
     if (!(opts & OPT_SYM_OWNER)) {
-        if ((res = apr_stat(&fi, d, lfi->valid & ~(APR_FINFO_NAME
-                                                 | APR_FINFO_LINK), p))
-                 != APR_SUCCESS) {
+        if (apr_stat(&fi, d, lfi->valid & ~(APR_FINFO_NAME | APR_FINFO_LINK), p)
+            != APR_SUCCESS)
+        {
             return HTTP_FORBIDDEN;
         }
 
@@ -431,15 +430,14 @@ static int resolve_symlink(char *d, apr_
      * owner of the symlink, then get the info of the target.
      */
     if (!(lfi->valid & APR_FINFO_OWNER)) {
-        if ((res = apr_stat(lfi, d,
-                            lfi->valid | APR_FINFO_LINK | APR_FINFO_OWNER, p))
-            != APR_SUCCESS) {
+        if (apr_stat(lfi, d, lfi->valid | APR_FINFO_LINK | APR_FINFO_OWNER, p)
+            != APR_SUCCESS)
+        {
             return HTTP_FORBIDDEN;
         }
     }
 
-    if ((res = apr_stat(&fi, d, lfi->valid & ~(APR_FINFO_NAME), p))
-        != APR_SUCCESS) {
+    if (apr_stat(&fi, d, lfi->valid & ~(APR_FINFO_NAME), p) != APR_SUCCESS) {
         return HTTP_FORBIDDEN;
     }
 

Modified: httpd/httpd/trunk/server/util_ebcdic.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_ebcdic.c?rev=982050&r1=982049&r2=982050&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_ebcdic.c (original)
+++ httpd/httpd/trunk/server/util_ebcdic.c Tue Aug  3 22:12:19 2010
@@ -29,7 +29,6 @@ APLOG_USE_MODULE(core);
 apr_status_t ap_init_ebcdic(apr_pool_t *pool)
 {
     apr_status_t rv;
-    char buf[80];
 
     rv = apr_xlate_open(&ap_hdrs_to_ascii, "ISO-8859-1", APR_DEFAULT_CHARSET, pool);
     if (rv) {



Re: svn commit: r982050 - in /httpd/httpd/trunk: modules/generators/ modules/slotmem/ modules/ssl/ server/ server/mpm/event/ server/mpm/netware/ server/mpm/prefork/

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Wednesday 04 August 2010, Jeff Trawick wrote:
> > Author: sf
> > Date: Tue Aug  3 22:12:19 2010
> > New Revision: 982050
> > 
> > URL: http://svn.apache.org/viewvc?rev=982050&view=rev
> > Log:
> > remove more unused variables
> > revove some obsolete comments
> > 
> > netware file is untested
> 
> why remove AP_DEBUG_ASSERT(0)?

Oops, somehow I was reading that as AP_DEBUG_ASSERT(1). Thanks for 
noticing.

Re: svn commit: r982050 - in /httpd/httpd/trunk: modules/generators/ modules/slotmem/ modules/ssl/ server/ server/mpm/event/ server/mpm/netware/ server/mpm/prefork/

Posted by Jeff Trawick <tr...@gmail.com>.
On Tue, Aug 3, 2010 at 6:12 PM,  <sf...@apache.org> wrote:
> Author: sf
> Date: Tue Aug  3 22:12:19 2010
> New Revision: 982050
>
> URL: http://svn.apache.org/viewvc?rev=982050&view=rev
> Log:
> remove more unused variables
> revove some obsolete comments
>
> netware file is untested

why remove AP_DEBUG_ASSERT(0)?

>
> Modified:
>    httpd/httpd/trunk/modules/generators/mod_cgid.c
>    httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
>    httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
>    httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c
>    httpd/httpd/trunk/modules/ssl/ssl_engine_rand.c
>    httpd/httpd/trunk/server/mpm/event/event.c
>    httpd/httpd/trunk/server/mpm/event/fdqueue.c
>    httpd/httpd/trunk/server/mpm/netware/mpm_netware.c
>    httpd/httpd/trunk/server/mpm/prefork/prefork.c
>    httpd/httpd/trunk/server/mpm_common.c
>    httpd/httpd/trunk/server/mpm_unix.c
>    httpd/httpd/trunk/server/request.c
>    httpd/httpd/trunk/server/util_ebcdic.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=982050&r1=982049&r2=982050&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/mpm/event/event.c (original)
> +++ httpd/httpd/trunk/server/mpm/event/event.c Tue Aug  3 22:12:19 2010
> @@ -1155,7 +1155,6 @@ static void * APR_THREAD_FUNC listener_t
>                                  ap_server_conf,
>                                  "event_loop: unexpected state %d",
>                                  cs->state);
> -                    AP_DEBUG_ASSERT(0);
>                 }
>
>                 apr_thread_mutex_lock(timeout_mutex);
>
> Modified: httpd/httpd/trunk/server/mpm/event/fdqueue.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/fdqueue.c?rev=982050&r1=982049&r2=982050&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/mpm/event/fdqueue.c (original)
> +++ httpd/httpd/trunk/server/mpm/event/fdqueue.c Tue Aug  3 22:12:19 2010
> @@ -165,7 +165,6 @@ apr_status_t ap_queue_info_wait_for_idle
>                                       queue_info->idlers_mutex);
>             if (rv != APR_SUCCESS) {
>                 apr_status_t rv2;
> -                AP_DEBUG_ASSERT(0);
>                 rv2 = apr_thread_mutex_unlock(queue_info->idlers_mutex);
>                 if (rv2 != APR_SUCCESS) {
>                     return rv2;
>