You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2009/12/01 09:44:12 UTC

svn commit: r885689 - in /httpd/httpd/trunk: modules/aaa/mod_auth_digest.c modules/cache/mod_disk_cache.c modules/cluster/mod_heartmonitor.c modules/proxy/balancers/mod_lbmethod_heartbeat.c modules/proxy/mod_proxy_scgi.c server/util_script.c

Author: wrowe
Date: Tue Dec  1 08:44:11 2009
New Revision: 885689

URL: http://svn.apache.org/viewvc?rev=885689&view=rev
Log:
Elaborate on low hanging XXX fruit

Modified:
    httpd/httpd/trunk/modules/aaa/mod_auth_digest.c
    httpd/httpd/trunk/modules/cache/mod_disk_cache.c
    httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c
    httpd/httpd/trunk/modules/proxy/mod_proxy_scgi.c
    httpd/httpd/trunk/server/util_script.c

Modified: httpd/httpd/trunk/modules/aaa/mod_auth_digest.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_auth_digest.c?rev=885689&r1=885688&r2=885689&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_auth_digest.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_auth_digest.c Tue Dec  1 08:44:11 2009
@@ -188,8 +188,8 @@
 #define DEF_NUM_BUCKETS 15L
 #define HASH_DEPTH      5
 
-static long shmem_size  = DEF_SHMEM_SIZE;
-static long num_buckets = DEF_NUM_BUCKETS;
+static apr_size_t shmem_size  = DEF_SHMEM_SIZE;
+static unsigned long num_buckets = DEF_NUM_BUCKETS;
 
 
 module AP_MODULE_DECLARE_DATA auth_digest_module;

Modified: httpd/httpd/trunk/modules/cache/mod_disk_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_disk_cache.c?rev=885689&r1=885688&r2=885689&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_disk_cache.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_disk_cache.c Tue Dec  1 08:44:11 2009
@@ -1082,8 +1082,8 @@
             file_cache_errorcleanup(dobj, r);
             return APR_EGENERAL;
         }
-        if (cl_header) {
-            apr_size_t cl = apr_atoi64(cl_header);
+        if (cl_header > 0) {
+            apr_size_t cl = (apr_size_t) apr_atoi64(cl_header);
             if ((errno == 0) && (dobj->file_size != cl)) {
                 ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                              "disk_cache: URL %s didn't receive complete response, not caching",

Modified: httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c?rev=885689&r1=885688&r2=885689&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c (original)
+++ httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c Tue Dec  1 08:44:11 2009
@@ -230,7 +230,7 @@
     apr_file_t *fp;
     apr_file_t *fpin;
     apr_time_t now;
-    unsigned int fage;
+    apr_time_t fage;
     apr_finfo_t fi;
     int updated = 0;
     char *path = apr_pstrcat(pool, ctx->storage_path, ".tmp.XXXXXX", NULL);
@@ -266,7 +266,7 @@
         bb = apr_brigade_create(pool, ba);
         apr_brigade_insert_file(bb, fpin, 0, fi.size, pool);
         tmpbb = apr_brigade_create(pool, ba);
-        fage = (unsigned int) apr_time_sec(now - fi.mtime);
+        fage = apr_time_sec(now - fi.mtime);
         do {
             char buf[4096];
             const char *ip;
@@ -300,7 +300,7 @@
                 apr_file_printf(fp, "%s\n", buf);
             } else if (strcmp(ip, s->ip) !=0 ) {
                 hm_server_t node; 
-                unsigned int seen;
+                apr_time_t seen;
                 /* Update seen time according to the last file modification */
                 apr_table_clear(hbt);
                 qs_to_table(apr_pstrdup(pool, t), hbt, pool);

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c?rev=885689&r1=885688&r2=885689&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c Tue Dec  1 08:44:11 2009
@@ -47,9 +47,9 @@
     const char *ip;
     int busy;
     int ready;
-    int seen;
     int port;
     int id;
+    apr_time_t seen;
     proxy_worker *worker;
 } hb_server_t;
 

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_scgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_scgi.c?rev=885689&r1=885688&r2=885689&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_scgi.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_scgi.c Tue Dec  1 08:44:11 2009
@@ -246,7 +246,8 @@
     const char *ns_len;
     const apr_array_header_t *env_table;
     const apr_table_entry_t *env;
-    apr_size_t j, len, bodylen_size;
+    int j;
+    apr_size_t len, bodylen_size;
     apr_size_t headerlen =   sizeof(CONTENT_LENGTH)
                            + sizeof(SCGI_MAGIC)
                            + sizeof(SCGI_PROTOCOL_VERSION);
@@ -265,7 +266,7 @@
      */
     env_table = apr_table_elts(r->subprocess_env);
     env = (apr_table_entry_t *)env_table->elts;
-    for (j=0; j<env_table->nelts; ++j) {
+    for (j = 0; j < env_table->nelts; ++j) {
         if (   (!strcmp(env[j].key, GATEWAY_INTERFACE))
             || (!strcmp(env[j].key, CONTENT_LENGTH))
             || (!strcmp(env[j].key, SCGI_MAGIC))) {
@@ -293,7 +294,7 @@
     memcpy(cp, SCGI_PROTOCOL_VERSION, sizeof(SCGI_PROTOCOL_VERSION));
     cp += sizeof(SCGI_PROTOCOL_VERSION);
 
-    for (j=0; j<env_table->nelts; ++j) {
+    for (j = 0; j < env_table->nelts; ++j) {
         if (   (!strcmp(env[j].key, GATEWAY_INTERFACE))
             || (!strcmp(env[j].key, CONTENT_LENGTH))
             || (!strcmp(env[j].key, SCGI_MAGIC))) {

Modified: httpd/httpd/trunk/server/util_script.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_script.c?rev=885689&r1=885688&r2=885689&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_script.c (original)
+++ httpd/httpd/trunk/server/util_script.c Tue Dec  1 08:44:11 2009
@@ -811,7 +811,9 @@
             if (!rv) {
                 apr_size_t total;
                 /* XXX where's our test that len fits in memory??? 
-                 * theoretically can be a large file > ram space
+                 * theoretically can be a large file > ram space.
+                 * need to cast len to apr_size_t but it would mask
+                 * this notable mistake
                  */
                 buffer = apr_palloc(tpool, len+1);