Oops my bad: Stop copying and pasting code.

Remove argstr_to_table and use qs_to_table.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@800685 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Frederic Clere
2009-08-04 06:49:48 +00:00
parent 7fd850f951
commit dcd3a1ebfb

View File

@ -124,6 +124,7 @@ static apr_status_t hm_listen(hm_ctx_t *ctx)
return APR_SUCCESS;
}
/* XXX: The same exists in mod_lbmethod_heartbeat.c where it is named argstr_to_table */
static void qs_to_table(const char *input, apr_table_t *parms,
apr_pool_t *p)
{
@ -203,34 +204,6 @@ static apr_status_t hm_slotmem_update_stat(hm_server_t *s, request_rec *r)
}
return APR_SUCCESS;
}
/* Copied from mod_lbmethod_heartbeat.c... */
static void
argstr_to_table(apr_pool_t *p, char *str, apr_table_t *parms)
{
char *key;
char *value;
char *strtok_state;
key = apr_strtok(str, "&", &strtok_state);
while (key) {
value = strchr(key, '=');
if (value) {
*value = '\0'; /* Split the string in two */
value++; /* Skip passed the = */
}
else {
value = "1";
}
ap_unescape_url(key);
ap_unescape_url(value);
apr_table_set(parms, key, value);
/*
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
"Found query arg: %s = %s", key, value);
*/
key = apr_strtok(NULL, "&", &strtok_state);
}
}
static apr_status_t hm_file_update_stat(hm_ctx_t *ctx, hm_server_t *s, apr_pool_t *pool)
{
apr_status_t rv;
@ -310,7 +283,7 @@ static apr_status_t hm_file_update_stat(hm_ctx_t *ctx, hm_server_t *s, apr_pool_
unsigned int seen;
/* Update seen time according to the last file modification */
apr_table_clear(hbt);
argstr_to_table(pool, apr_pstrdup(pool, t), hbt);
qs_to_table(apr_pstrdup(pool, t), hbt, pool);
if (apr_table_get(hbt, "busy")) {
node.busy = atoi(apr_table_get(hbt, "busy"));
} else {