i want to push my "set scheme in http" diff again, but it makes
sense to reuse server_port as part of that.

this makes server_port more palatable to me.

ok?

Index: src/main/http_core.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/main/http_core.c,v
retrieving revision 1.27
diff -u -p -r1.27 http_core.c
--- src/main/http_core.c        10 May 2010 02:00:50 -0000      1.27
+++ src/main/http_core.c        25 Aug 2011 10:23:02 -0000
@@ -1779,14 +1779,16 @@ static const char *server_port(cmd_parms
     if (err != NULL) {
        return err;
     }
-    port = atoi(arg);
-    if (port <= 0 || port >= 65536) { /* 65536 == 1<<16 */
-       return ap_pstrcat(cmd->temp_pool, "The port number \"", arg, 
-                         "\" is outside the appropriate range "
-                         "(i.e., 1..65535).", NULL);
+
+    port = (int)strtonum(arg, 1, 65535, &err);
+    if (err != NULL) {
+       return ap_pstrcat(cmd->temp_pool,
+         "The port number \"", arg, "\" is ", err, NULL);
     }
+
     cmd->server->port = port;
-    return NULL;
+
+    return (NULL);
 }
 
 static const char *set_signature_flag(cmd_parms *cmd, core_dir_config *d, 

Reply via email to