httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r800685 - /httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c
Date Tue, 04 Aug 2009 06:49:48 GMT
Author: jfclere
Date: Tue Aug  4 06:49:48 2009
New Revision: 800685

URL: http://svn.apache.org/viewvc?rev=800685&view=rev
Log:
Oops my bad: Stop copying and pasting code.
Remove argstr_to_table and use qs_to_table.

Modified:
    httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c

Modified: httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c?rev=800685&r1=800684&r2=800685&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c (original)
+++ httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c Tue Aug  4 06:49:48 2009
@@ -124,6 +124,7 @@
     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 @@
     }
     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 @@
                 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 {



Mime
View raw message