httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@worldgate.com>
Subject Re: function to split URL into components
Date Mon, 08 Sep 1997 21:12:38 GMT
On Mon, 8 Sep 1997, Martin Kraemer wrote:

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

The problem is that I am not sure how many places would be able to use
this and how many would need a function for a possibly different URL
anyway.

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

I think I would prefer this.  If you are going to do it, look at Roy's
suggestion of using a regex.

> 
>     Martin
> -- 
> | S I E M E N S |  <Martin.Kraemer@mch.sni.de>  |      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
> 


Mime
View raw message