]> granicus.if.org Git - apache/commitdiff
* easy proposals to synch 2.4.x and trunk
authorGraham Leggett <minfrin@apache.org>
Thu, 26 Dec 2013 18:08:28 +0000 (18:08 +0000)
committerGraham Leggett <minfrin@apache.org>
Thu, 26 Dec 2013 18:08:28 +0000 (18:08 +0000)
  - log.c: avoid needless apr_pstrdup()
  - Use apr_pstrmemdup instead of apr_pstrndup when this is safe.
  - Use apr_pstrmemdup instead of apr_pstrndup when this is safe.
  - Remove redundant check
  - 'ap_getword_conf' does not return NULL but an empty string
  - Ease logic around 'ap_getword_conf' and drop useless line of code.
  - 'ap_getword_conf' can not return NULL
  - 'ap_getword_conf' can not return NULL
  - Remove redundant check (already performed the line before)
  - Use 'apr_pstrmemdup' instead of 'apr_pstrndup' when applicable
trunk patches:
  - https://svn.apache.org/viewvc?view=revision&revision=1532122
  - https://svn.apache.org/viewvc?view=revision&revision=1549676
  - https://svn.apache.org/viewvc?view=revision&revision=1549680
  - https://svn.apache.org/viewvc?view=revision&revision=1550651
  - https://svn.apache.org/viewvc?view=revision&revision=1551005
  - https://svn.apache.org/viewvc?view=revision&revision=1551009
  - https://svn.apache.org/viewvc?view=revision&revision=1551010
  - https://svn.apache.org/viewvc?view=revision&revision=1551011
  - https://svn.apache.org/viewvc?view=revision&revision=1551012
  - https://svn.apache.org/viewvc?view=revision&revision=1551013
2.4.x patches: trunk patches work
               http://people.apache.org/~jim/patches/ez-2.4-v2.patch
+1: jailletc36, jim, minfrin

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1553532 13f79535-47bb-0310-9956-ffa450edef68

12 files changed:
STATUS
modules/cache/mod_cache_disk.c
modules/cluster/mod_heartmonitor.c
modules/lua/mod_lua.c
modules/mappers/mod_dir.c
modules/metadata/mod_expires.c
modules/metadata/mod_remoteip.c
modules/proxy/balancers/mod_lbmethod_heartbeat.c
modules/session/mod_session_crypto.c
os/unix/unixd.c
server/log.c
server/util_ebcdic.c

diff --git a/STATUS b/STATUS
index d9c4c3bdd4d3918bf5005fd267808f38c9e9eef5..872a4f6633b7516f312f8b570bd081fca80d96d8 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -98,31 +98,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  * easy proposals to synch 2.4.x and trunk
-      - log.c: avoid needless apr_pstrdup()
-      - Use apr_pstrmemdup instead of apr_pstrndup when this is safe.
-      - Use apr_pstrmemdup instead of apr_pstrndup when this is safe.
-      - Remove redundant check
-      - 'ap_getword_conf' does not return NULL but an empty string
-      - Ease logic around 'ap_getword_conf' and drop useless line of code.
-      - 'ap_getword_conf' can not return NULL
-      - 'ap_getword_conf' can not return NULL
-      - Remove redundant check (already performed the line before)
-      - Use 'apr_pstrmemdup' instead of 'apr_pstrndup' when applicable
-    trunk patches:
-      - https://svn.apache.org/viewvc?view=revision&revision=1532122
-      - https://svn.apache.org/viewvc?view=revision&revision=1549676
-      - https://svn.apache.org/viewvc?view=revision&revision=1549680
-      - https://svn.apache.org/viewvc?view=revision&revision=1550651
-      - https://svn.apache.org/viewvc?view=revision&revision=1551005
-      - https://svn.apache.org/viewvc?view=revision&revision=1551009
-      - https://svn.apache.org/viewvc?view=revision&revision=1551010
-      - https://svn.apache.org/viewvc?view=revision&revision=1551011
-      - https://svn.apache.org/viewvc?view=revision&revision=1551012
-      - https://svn.apache.org/viewvc?view=revision&revision=1551013
-    2.4.x patches: trunk patches work
-                   http://people.apache.org/~jim/patches/ez-2.4-v2.patch
-    +1: jailletc36, jim, minfrin
 
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
index 2b50aef994496f29b7576fbb012cc922fa5de3e1..95ff1fc029054585f5dd519c6699b752d48542ca 100644 (file)
@@ -381,7 +381,7 @@ static int create_entity(cache_handle_t *h, request_rec *r, const char *key, apr
     dobj->name = obj->key;
     dobj->prefix = NULL;
     /* Save the cache root */
-    dobj->root = apr_pstrndup(r->pool, conf->cache_root, conf->cache_root_len);
+    dobj->root = apr_pstrmemdup(r->pool, conf->cache_root, conf->cache_root_len);
     dobj->root_len = conf->cache_root_len;
 
     apr_pool_create(&pool, r->pool);
@@ -441,7 +441,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
     dobj->prefix = NULL;
 
     /* Save the cache root */
-    dobj->root = apr_pstrndup(r->pool, conf->cache_root, conf->cache_root_len);
+    dobj->root = apr_pstrmemdup(r->pool, conf->cache_root, conf->cache_root_len);
     dobj->root_len = conf->cache_root_len;
 
     dobj->vary.file = header_file(r->pool, conf, dobj, key);
index 8e4231dc37e2f3c0e3113eea4b777c0d0623ab63..b3d666ba226482636753d1b751b82f5b9b0b25c0 100644 (file)
@@ -292,7 +292,7 @@ static apr_status_t hm_file_update_stat(hm_ctx_t *ctx, hm_server_t *s, apr_pool_
             buf[bsize - 1] = 0;
             t = strchr(buf, ' ');
             if (t) {
-                ip = apr_pstrndup(pool, buf, t - buf);
+                ip = apr_pstrmemdup(pool, buf, t - buf);
             } else {
                 ip = NULL;
             }
index 6e3390fbd2f346668c4f655821ec0c10e2a66fca..3eda5fc1a28a715cbbb9d993cf41670870c97775 100644 (file)
@@ -954,11 +954,11 @@ static const char *register_named_block_function_hook(const char *name,
     if (line[0]) { 
         const char *word;
         word = ap_getword_conf(cmd->temp_pool, &line);
-        if (word && *word) {
+        if (*word) {
             function = apr_pstrdup(cmd->pool, word);
         }
         word = ap_getword_conf(cmd->temp_pool, &line);
-        if (word && *word) {
+        if (*word) {
             if (!strcasecmp("early", word)) { 
                 when = AP_LUA_HOOK_FIRST;
             }
index 4364ff955152bdfcc53d7d93e7772ef6e11d27c0..9707ad50bec739a6299ccee6f25aee67098992ae 100644 (file)
@@ -66,7 +66,7 @@ static const char *add_index(cmd_parms *cmd, void *dummy, const char *arg)
             /* peek to see if "disabled" is first in a series of arguments */
             const char *tt = t;
             const char *ww = ap_getword_conf(cmd->temp_pool, &tt);
-            if (ww == NULL || !ww[0]) {
+            if (ww[0] == '\0') {
                /* "disabled" is first, and alone */
                apr_array_clear(d->index_names); 
                break;
index 2ef3d89953a40d27248a686180e70912ba2ab9ed..049cfc2250961029d993a00e601f7c538ede2aaf 100644 (file)
@@ -267,10 +267,7 @@ static char *check_code(apr_pool_t *p, const char *code, char **real_code)
         /* <type>
          */
         word = ap_getword_conf(p, &code);
-        if (word[0]) {
-            /* do nothing */
-        }
-        else {
+        if (word[0] == '\0') {
             return apr_pstrcat(p, "bad expires code, missing <type>", NULL);
         }
 
index 74ea80350c1c7a3fa0ce468282f140f36c3d561a..1926066119a0de4f5f67e6579e9e7ba5e3d5489f 100644 (file)
@@ -198,7 +198,7 @@ static const char *proxylist_read(cmd_parms *cmd, void *cfg,
     while (!(ap_cfg_getline(lbuf, MAX_STRING_LEN, cfp))) {
         args = lbuf;
         while (*(arg = ap_getword_conf(cmd->temp_pool, &args)) != '\0') {
-            if (*arg == '#' || *arg == '\0') {
+            if (*arg == '#') {
                 break;
             }
             errmsg = proxies_set(cmd, cfg, arg);
index 77fb994ff1a8de93cb68f854c13f7fd551b05da2..e9e1034405af928dd9ce4ae5f02afef775571aaf 100644 (file)
@@ -162,7 +162,7 @@ static apr_status_t readfile_heartbeats(const char *path, apr_hash_t *servers,
                 continue;
             }
 
-            ip = apr_pstrndup(pool, buf, t - buf);
+            ip = apr_pstrmemdup(pool, buf, t - buf);
             t++;
 
             server = apr_hash_get(servers, ip, APR_HASH_KEY_STRING);
index 984a048762ec3c98ee10c5b48ddb8fbbee9b7566..4d65bb8376de99e6cb58543cf9a7924e534cdb94 100644 (file)
@@ -593,7 +593,7 @@ static const char *set_crypto_passphrase_file(cmd_parms *cmd, void *config,
     while (!(ap_cfg_getline(buffer, sizeof(buffer), file))) {
         args = buffer;
         while (*(arg = ap_getword_conf(cmd->pool, &args)) != '\0') {
-            if (*arg == '#' || *arg == 0) {
+            if (*arg == '#') {
                 break;
             }
             set_crypto_passphrase(cmd, config, arg);
index a86630f39b4c750728677076f990fa1ab0897521..c10ea9d6992b03f5f02af12de27cd5f1f3a9e8d2 100644 (file)
@@ -74,7 +74,7 @@ AP_DECLARE(void) ap_unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit,
         return;
     }
 
-    if ((str = ap_getword_conf(cmd->pool, &arg))) {
+    if (*(str = ap_getword_conf(cmd->pool, &arg)) != '\0') {
         if (!strcasecmp(str, "max")) {
             cur = limit->rlim_max;
         }
@@ -88,7 +88,7 @@ AP_DECLARE(void) ap_unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit,
         return;
     }
 
-    if (arg2 && (str = ap_getword_conf(cmd->pool, &arg2))) {
+    if (arg2 && (*(str = ap_getword_conf(cmd->pool, &arg2)) != '\0')) {
         max = atol(str);
     }
 
index bcfdcdb6ebfef9c190455824a2bdb943c2ad5568..9a15d24dbbcd022b32f43da95b01d8909779cb6e 100644 (file)
@@ -331,10 +331,8 @@ static int log_child(apr_pool_t *p, const char *progname,
         && ((rc = apr_procattr_child_errfn_set(procattr, log_child_errfn))
                 == APR_SUCCESS)) {
         char **args;
-        const char *pname;
 
         apr_tokenize_to_argv(progname, &args, p);
-        pname = apr_pstrdup(p, args[0]);
         procnew = (apr_proc_t *)apr_pcalloc(p, sizeof(*procnew));
 
         if (dummy_stderr) {
@@ -342,7 +340,7 @@ static int log_child(apr_pool_t *p, const char *progname,
                 rc = apr_procattr_child_err_set(procattr, errfile, NULL);
         }
 
-        rc = apr_proc_create(procnew, pname, (const char * const *)args,
+        rc = apr_proc_create(procnew, args[0], (const char * const *)args,
                              NULL, procattr, p);
 
         if (rc == APR_SUCCESS) {
@@ -1566,12 +1564,10 @@ static apr_status_t piped_log_spawn(piped_log *pl)
     }
     else {
         char **args;
-        const char *pname;
 
         apr_tokenize_to_argv(pl->program, &args, pl->p);
-        pname = apr_pstrdup(pl->p, args[0]);
         procnew = apr_pcalloc(pl->p, sizeof(apr_proc_t));
-        status = apr_proc_create(procnew, pname, (const char * const *) args,
+        status = apr_proc_create(procnew, args[0], (const char * const *) args,
                                  NULL, procattr, pl->p);
 
         if (status == APR_SUCCESS) {
index 1a8c0ba305066eb384af80f708500099e08ed3cc..7faae794de91f26fb0850c569369df60468e5de6 100644 (file)
@@ -102,7 +102,7 @@ int ap_rvputs_proto_in_ascii(request_rec *r, ...)
         if (s == NULL)
             break;
         len = strlen(s);
-        ascii_s = apr_pstrndup(r->pool, s, len);
+        ascii_s = apr_pstrmemdup(r->pool, s, len);
         ap_xlate_proto_to_ascii(ascii_s, len);
         if (ap_rputs(ascii_s, r) < 0)
             return -1;