From 605a598ef34c525c96a7840bed3f86f5efef83f9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 12 Mar 2019 09:29:24 +0000 Subject: [PATCH] Merge r1486027, r1828909, r1839249, r1842888, r1844343, r1846651 from trunk: Clarify the existing behavior. * modules/generators/mod_info.c: Constify fixed tables and mark module-private global variables static. No functional change. Axe an old and apparently out-dated comment. There is a typo in the comment. HN_UPDATE_SEC has been renamed HM_UPDATE_SEC. The TODO seems to have been taken into account in r759862. * modules/filters/mod_deflate.c (deflate_out_filter): Fix typo setting output note. (Coverity warning) (deflate_in_filter): Fix redundant assignment. (clang warning) * modules/md/md_acme_authz.c (md_acme_authz_update): Fix typo in log message. * modules/dav/main/mod_dav.c (dav_method_propfind): Tag the scratchpool. Submitted by: minfrin, jorton, jailletc36 Reviewed by: jailletc36, icing, jorton git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855300 13f79535-47bb-0310-9956-ffa450edef68 --- modules/cluster/mod_heartmonitor.c | 4 +--- modules/dav/main/mod_dav.c | 1 + modules/dav/main/props.c | 4 ++++ modules/filters/mod_deflate.c | 4 +--- modules/generators/mod_info.c | 12 ++++++------ modules/md/md_acme_authz.c | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/modules/cluster/mod_heartmonitor.c b/modules/cluster/mod_heartmonitor.c index 965fef58992..61a851764d0 100644 --- a/modules/cluster/mod_heartmonitor.c +++ b/modules/cluster/mod_heartmonitor.c @@ -624,9 +624,7 @@ static apr_status_t hm_watchdog_callback(int state, void *data, /* store in the slotmem or in the file depending on configuration */ hm_update_stats(ctx, pool); cur = now = apr_time_sec(apr_time_now()); - /* TODO: Insted HN_UPDATE_SEC use - * the ctx->interval - */ + while ((now - cur) < apr_time_sec(ctx->interval)) { int n; apr_status_t rc; diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index 84012f2d7ac..b969465a98b 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -2113,6 +2113,7 @@ static int dav_method_propfind(request_rec *r) ctx.r = r; ctx.bb = apr_brigade_create(r->pool, r->connection->bucket_alloc); apr_pool_create(&ctx.scratchpool, r->pool); + apr_pool_tag(ctx.scratchpool, "mod_dav-scratch"); /* ### should open read-only */ if ((err = dav_open_lockdb(r, 0, &ctx.w.lockdb)) != NULL) { diff --git a/modules/dav/main/props.c b/modules/dav/main/props.c index f64878e67fe..47cc509bd47 100644 --- a/modules/dav/main/props.c +++ b/modules/dav/main/props.c @@ -1047,6 +1047,10 @@ DAV_DECLARE_NONSTD(void) dav_prop_exec(dav_prop_ctx *ctx) /* ** Delete the property. Ignore errors -- the property is there, or ** we are deleting it for a second time. + ** + ** http://tools.ietf.org/html/rfc4918#section-14.23 says + ** "Specifying the removal of a property that does not exist is + ** not an error" */ /* ### but what about other errors? */ (void) (*propdb->db_hooks->remove)(propdb->db, &name); diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index d60b2de6f43..e714ca68c8e 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -866,7 +866,7 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, if (c->note_output_name) { apr_table_setn(r->notes, c->note_output_name, - (ctx->stream.total_in > 0) + (ctx->stream.total_out > 0) ? apr_off_t_toa(r->pool, ctx->stream.total_out) : "-"); @@ -1338,8 +1338,6 @@ static apr_status_t deflate_in_filter(ap_filter_t *f, ctx->stream.next_in = (unsigned char *)data; ctx->stream.avail_in = (int)len; - zRC = Z_OK; - if (!ctx->validation_buffer) { while (ctx->stream.avail_in != 0) { if (ctx->stream.avail_out == 0) { diff --git a/modules/generators/mod_info.c b/modules/generators/mod_info.c index e5e63de1378..7876264d41a 100644 --- a/modules/generators/mod_info.c +++ b/modules/generators/mod_info.c @@ -80,9 +80,9 @@ typedef struct module AP_MODULE_DECLARE_DATA info_module; /* current file name when doing -DDUMP_CONFIG */ -const char *dump_config_fn_info; +static const char *dump_config_fn_info; /* file handle when doing -DDUMP_CONFIG */ -apr_file_t *out = NULL; +static apr_file_t *out = NULL; static void *create_info_config(apr_pool_t * p, server_rec * s) { @@ -297,7 +297,7 @@ typedef struct hook_get_t get; } hook_lookup_t; -static hook_lookup_t startup_hooks[] = { +static const hook_lookup_t startup_hooks[] = { {"Pre-Config", ap_hook_get_pre_config}, {"Check Configuration", ap_hook_get_check_config}, {"Test Configuration", ap_hook_get_test_config}, @@ -311,7 +311,7 @@ static hook_lookup_t startup_hooks[] = { {NULL}, }; -static hook_lookup_t request_hooks[] = { +static const hook_lookup_t request_hooks[] = { {"Pre-Connection", ap_hook_get_pre_connection}, {"Create Connection", ap_hook_get_create_connection}, {"Process Connection", ap_hook_get_process_connection}, @@ -339,7 +339,7 @@ static hook_lookup_t request_hooks[] = { {NULL}, }; -static hook_lookup_t other_hooks[] = { +static const hook_lookup_t other_hooks[] = { {"Monitor", ap_hook_get_monitor}, {"Child Status", ap_hook_get_child_status}, {"End Generation", ap_hook_get_end_generation}, @@ -378,7 +378,7 @@ static int module_find_hook(module * modp, hook_get_t hook_get) static void module_participate(request_rec * r, module * modp, - hook_lookup_t * lookup, int *comma) + const hook_lookup_t *lookup, int *comma) { if (module_find_hook(modp, lookup->get)) { if (*comma) { diff --git a/modules/md/md_acme_authz.c b/modules/md/md_acme_authz.c index 2b5cbdc5a03..2295745b7b4 100644 --- a/modules/md/md_acme_authz.c +++ b/modules/md/md_acme_authz.c @@ -239,7 +239,7 @@ apr_status_t md_acme_authz_update(md_acme_authz_t *authz, md_acme_t *acme, if (md_log_is_level(p, log_level)) { md_log_perror(MD_LOG_MARK, log_level, rv, p, "ACME server authz: %s for %s at %s. " - "Exact repsonse was: %s", err? err : "", authz->domain, authz->location, + "Exact response was: %s", err? err : "", authz->domain, authz->location, json? md_json_writep(json, p, MD_JSON_FMT_COMPACT) : "not available"); } -- 2.47.3