httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <>
Subject Re: function to split URL into components
Date Mon, 08 Sep 1997 20:59:25 GMT
On Sat, Sep 06, 1997 at 07:30:01PM -0400, Rodent of Unusual Size wrote:
>     No, I don't think we have a general-purposes one - and yes, I think
>     we should have one in the core (not the proxy).  Bear in mind that
>     there are some funky rules here, particularly around URL syntaces
>     such as "ftp://user:password@host/".
I've been in the Austrian mountains over the weekend, and I read this
thread only now, monday evening. What a funny coincidence: over the weekend,
I've written exactly such a function -on paper- because I felt it was
needed in many places, (http_protocol needs it a couple of times,
mod_proxy needs it badly, other modules re-parse the uri again and again)
IMHO, it belongs into parse_uri (in http_protocol), and as I solved it,
it puts all its components into a structure, flagging what's in there.
(unsigned has_scheme:1, has_user:1, has_password:1, has_port:1, etc.).
This central information needs to be parsed only once, directly after the
request has arrived. It is thereafter much simpler to check for a request
to the server host (as is done in check_fulluri()) and other checks.

Should I add it to parse_uri(), or would you prefer to adapt the
proxy_canonenc() routine for this?

| S I E M E N S |  <>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

View raw message