Re: Comparing URLs

Henrik Frystyk Nielsen wrote:
> 
> At 08:01 13/03/1999 +0000, Vaclav Barta wrote:
> >Hi,
> >
> >HTTP 1.1 standard defines an algorithm for comparing URLs (paths
> >are case sensitive, default port is 80...), which I'm too lazy
> >to implement. Is there a function like
> >       int compare_url(const char *url1, const char *url2);
> >in libwww (or somewhere else)? I looked how webbot does it but
> >I keep getting lost...
> 
> You can have a look at the URI canonicalization function in
> 
>         http://www.w3.org/Library/src/HTParse.html
> 
> It actually changes the string and is used when creating a new anchor:
> 
>         PUBLIC HTAnchor * HTAnchor_findAddress (const char * address)
> 
> which can be found in
> 
>         http://www.w3.org/Library/src/HTAnchor.html
> 
> There is no direct function that says: Are these two URIs identical. What
> libwww normally does is to create anchor objects for each URI and identical
> URIs of course will have the same anchor. You are welcome to add one based
> on HTSimplify so that I can add it.
Thanks. As I come to think about it (and look at HTSimplify :-) ), it
would probably make more sense for me to just use canonical URIs...

	Bye
		Vasek
--
I have a search engine, too!
http://www.locus.cz/locus/

Received on Thursday, 25 March 1999 06:15:35 UTC