On Thu, 21 Sep 2000 22:39:08 +0200, Bernie wrote:
> Host software MUST handle host names of up to 63 characters
> and SHOULD handle host names of up to 255 characters.
Well, how about supported *both* ? ;-)
> So I guess this will need to be changed in Arachne (but I think
> 63 "should be enough for everyone").
Instead of pre-defining a static string space, how about replacing
it with a dynamic buffer? Something like
#include <alloc.h>
char *hostname = malloc(41);
IMHO, this will keep memory usage as low as possible. Whenever
the URL parser encountering a hostname that longer than 40 chars,
then it could increase the string space to either 63 or 255 as
needed:
if (hostlen > 40 && hostlen <= 63)
{
hostname = realloc(hostname,64);
}
else if (hostlen > 63 && hostlen <= 255)
{
hostname = realloc(hostname,256);
}
else
{
die(); // giving up, violating RFC
}
Add error/repetitive handling codes as needed of course, a little
more complex than this, but at least you'll get the idea... ;-)
BTW, if you came as a guest with Arachne, Yahoo! WebRing's login
page at the link "Join the Ring" (see URLs at my sig below) will
redirect you to a wrong URL *after* login. Arachne will get a
single character added to the target URL (i.e. "http:<blah>dosnet"
will become "http:<blah>dosneti"). Is this Yahoo!'s fault or just
another Arachne bug? As usual, both IE and Netscape has no such
problem.
--Eko
http://www.survpc.net/ - Older PC and DOS Internet
http://survpc.virtualave.net/ (noframe)