- 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
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:
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);
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);
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;
}
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;
}
/* 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;
/* <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);
}
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);
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);
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);
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;
}
return;
}
- if (arg2 && (str = ap_getword_conf(cmd->pool, &arg2))) {
+ if (arg2 && (*(str = ap_getword_conf(cmd->pool, &arg2)) != '\0')) {
max = atol(str);
}
&& ((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) {
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) {
}
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) {
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;