]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Elaborate on low hanging XXX fruit
authorWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 1 Dec 2009 08:44:11 +0000 (08:44 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 1 Dec 2009 08:44:11 +0000 (08:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@885689 13f79535-47bb-0310-9956-ffa450edef68

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

index 63c95755528dec862d25b15168a9ffc9554b8335..fa0c8a515ec8f28804605af4dd6e94d3b711741f 100644 (file)
@@ -188,8 +188,8 @@ static const char     *client_shm_filename;
 #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;
index b3817496eec6a5884f324ff36c60a7145cacd70d..31c85fe1c1af326f80195e70880f3e6e4e62ab6d 100644 (file)
@@ -1082,8 +1082,8 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r,
             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",
index 9933ca77dea05dd89255a647175b2d0ac52659e7..1e4a92341fb11ceded6d813848610477f1b2fb02 100644 (file)
@@ -230,7 +230,7 @@ static apr_status_t hm_file_update_stat(hm_ctx_t *ctx, hm_server_t *s, apr_pool_
     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 @@ static apr_status_t hm_file_update_stat(hm_ctx_t *ctx, hm_server_t *s, apr_pool_
         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 @@ static apr_status_t hm_file_update_stat(hm_ctx_t *ctx, hm_server_t *s, apr_pool_
                 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);
index ac859186b08aa71da8f7ac41894ca6b7d7e2a90e..a1dc2ca6875160908a8d29c1d9ab04334463fa89 100644 (file)
@@ -47,9 +47,9 @@ typedef struct hb_server_t {
     const char *ip;
     int busy;
     int ready;
-    int seen;
     int port;
     int id;
+    apr_time_t seen;
     proxy_worker *worker;
 } hb_server_t;
 
index 6bc0b47cbaaaabe8e4827a0a50c98f1d2342a5e8..1f16ae47cf4aa4fd9b91e139a4f057199d927cc4 100644 (file)
@@ -246,7 +246,8 @@ static int send_headers(request_rec *r, proxy_conn_rec *conn)
     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 @@ static int send_headers(request_rec *r, proxy_conn_rec *conn)
      */
     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 @@ static int send_headers(request_rec *r, proxy_conn_rec *conn)
     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))) {
index 0e22943ec0641ec3a0371f2db001bdb2f1d03505..58983079de8c923e0bbb45c3df43f0a11eded4b1 100644 (file)
@@ -811,7 +811,9 @@ AP_DECLARE(apr_status_t) ap_body_to_table(request_rec *r, apr_table_t **table)
             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);