Module Name:    src
Committed By:   leot
Date:           Sat Dec 15 12:43:24 UTC 2018

Modified Files:
        src/libexec/httpd: bozohttpd.c

Log Message:
Fix handling of bozo_set_timeout() timeouts (and `-T' option parsing)


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/libexec/httpd/bozohttpd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.105 src/libexec/httpd/bozohttpd.c:1.106
--- src/libexec/httpd/bozohttpd.c:1.105	Sat Dec 15 12:39:22 2018
+++ src/libexec/httpd/bozohttpd.c	Sat Dec 15 12:43:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.105 2018/12/15 12:39:22 leot Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.106 2018/12/15 12:43:24 leot Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -398,7 +398,7 @@ int
 bozo_set_timeout(bozohttpd_t *httpd, bozoprefs_t *prefs,
 		 const char *target, const char *val)
 {
-	const char *cur, *timeouts[] = {
+	const char **cur, *timeouts[] = {
 		"initial timeout",
 		"header timeout",
 		"request timeout",
@@ -408,9 +408,9 @@ bozo_set_timeout(bozohttpd_t *httpd, boz
 	const size_t minlen = 1;
 	size_t len = strlen(target);
 
-	for (cur = timeouts[0]; len >= minlen && *cur; cur++) {
-		if (strncmp(target, cur, len) == 0) {
-			bozo_set_pref(httpd, prefs, cur, val);
+	for (cur = timeouts; len >= minlen && *cur; cur++) {
+		if (strncmp(target, *cur, len) == 0) {
+			bozo_set_pref(httpd, prefs, *cur, val);
 			return 0;
 		}
 	}

Reply via email to