this case is ambiguous. ('Listen 127.0.0.1' doesn't make any sense.)
(Rich came up with the problem. Cliff came up with the error text. Justin
did the ap_strtol call.)
Reviewed by: Cliff Woolley, Rich Bowen
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@97553
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 1.3.28
+
+ *) If Listen directive is not a port, but just an IP, emit an
+ error condition as this case is ambiguous.
+ [Rich Bowen, Justin Erenkrantz, Cliff Woolley]
+
*) Update timeout algorithm in free_proc_chain. If a subprocess
did not exit immediately, the thread would sleep for 3 seconds
before checking the subprocess exit status again. In a very
static const char *set_listener(cmd_parms *cmd, void *dummy, char *ips)
{
listen_rec *new;
- char *ports;
+ char *ports, *endptr;
unsigned short port;
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
else {
new->local_addr.sin_addr.s_addr = ap_get_virthost_addr(ips, NULL);
}
- port = atoi(ports);
- if (!port) {
- return "Port must be numeric";
+ port = ap_strtol(ports, &endptr, 10);
+ if (errno || (endptr && *endptr) || !port) {
+ return "Missing or non-numeric port";
}
new->local_addr.sin_port = htons(port);
new->fd = -1;