On Thu, Aug 25, 2011 at 08:25:00PM +1000, David Gwynne wrote:
> 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?

Can't see that this changes anything, and it does look better, so
ok krw@.

.... Ken

> 
> 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