]> granicus.if.org Git - apache/commitdiff
Better check
authorJim Jagielski <jim@apache.org>
Wed, 30 Dec 2015 12:02:49 +0000 (12:02 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 30 Dec 2015 12:02:49 +0000 (12:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1722320 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_hcheck.c

index a9b39fc84700b9c0ac3f9036303e39473920d011..4f214af4e158975982c7f46a0e2c04ba858c89b1 100644 (file)
@@ -28,7 +28,7 @@ module AP_MODULE_DECLARE_DATA proxy_hcheck_module;
 #define HCHECK_WATHCHDOG_INTERVAL (5)
 
 static char *methods[] = {
-      "NULL", "OPTIONS", "HEAD", "GET", "POST", "CPING"
+      "NULL", "OPTIONS", "HEAD", "GET", "POST", "CPING", NULL
 };
 
 typedef struct hc_template_t {
@@ -78,7 +78,7 @@ static const char *set_worker_hc_param(apr_pool_t *p,
         return apr_psprintf(p, "Unknown HCheckTemplate name: %s", val);
     }
     else if (!strcasecmp(key, "method")) {
-        for (ival = 1; ival < sizeof(methods); ival++) {
+        for (ival = 1; methods[ival]; ival++) {
             if (!ap_casecmpstr(val, methods[ival])) {
                 if (worker) {
                     worker->s->method = ival;