On Mon, Nov 16, 2026 at 3:19 PM Rainer Jung <[email protected]> wrote:
>
> Am 16.11.26 um 14:29 schrieb Yann Ylavic:
> > On Sat, Nov 14, 2026 at 10:51 PM Rainer Jung <[email protected]> 
> > wrote:
> >>
> >> Index: uri/apr_uri.c
> >> ===================================================================
> >> --- uri/apr_uri.c       (Revision 1940324)
> >> +++ uri/apr_uri.c       (Arbeitskopie)
> >> @@ -900,6 +900,7 @@
> >>        /* scheme must be non-empty and followed by : */
> >>        if (s != uri && s[0] == ':') {
> >>            uptr->scheme = apr_pstrmemdup(p, uri, s - uri);
> >> +        uptr->port = apr_uri_port_of_scheme(uptr->scheme);
> >>            s++;
> >>        }
> >>        else {
> >> @@ -1017,7 +1018,6 @@
> >>                /* Invalid characters after ':' found */
> >>                return APR_EGENERAL;
> >>            }
> >> -        uptr->port = apr_uri_port_of_scheme(uptr->scheme);
> >>            goto deal_with_path;
> >>        }
> >
> >
> > Can't we delay apr_uri_port_of_scheme() until we know there is no ":port" 
> > still?
> >
> > Cheers;
> > Yann.
>
> Due to the use of goto, the code jumps a bit back and forth. So I found
> it more robust to set immediately a default port when the scheme is
> found and then overwrite it when a specific port is found than to find
> all the exit points after (not necessarily below) the port detection and
> then fall back to the default.

Just committed r1940785 with the minimal apr_uri_port_of_scheme()
placement and exhaustive tests.
Also r1940777 for the optimized apr_uri_port_of_scheme() discussed below.


Cheers;
Yann.

Reply via email to