MEDIUM: proxy: make timeout parser a bit stricter
Twice in a week I found people were surprized by a "conditional timeout" not
being respected, because they add "if <cond>" after a timeout, and since
they don't see any error nor read the doc, the expect it to work. Let's
make the timeout parser reject extra arguments to avoid these situations.
diff --git a/src/proxy.c b/src/proxy.c
index 493df70..02103ee 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -233,6 +233,11 @@
}
}
+ if (*args[2] != 0) {
+ memprintf(err, "'timeout %s' : unexpected extra argument '%s' after value '%s'.", name, args[2], args[1]);
+ retval = -1;
+ }
+
*tv = MS_TO_TICKS(timeout);
return retval;
}