Bug in HTMIME_put_block?

Hi,
 
I am new to libwww, so I may be wrong, but I think
there is a bug in the mime parser.
 
When parsing the headers the trace always shows
the first MIME token as part of the value string also:
 
    MIME header. Server: Server: name/version
 
or in another request:
 
    MIME header. WWW-Authenticate: WWW-Authenticate: Basic
realm="www.host.name"
 
Subsequent headers are parsed correctly.
 
Debugging the code (under Windows NT) shows that this is indeed
the case (and in my case the authentification fails to find an appropriate
handler). It appears that the "value" variable is not being initialised 
correctly the first time around the loop, it is being set to the start of
the headers "b" rather than NULL.
 
I changed the following line (in my copy of the code):
 
HTMime.c: (272)
    FROM: const char * value = HTChunk_size(me->value) >= 0 ? b : NULL;
    TO:      const char * value = HTChunk_size(me->value) > 0 ? b : NULL;
 
I am not sure of the reason for this line, why it is not always set to NULL,
so perhaps someone who knows the code better can explain / check my
change and check it in for me if this is correct.
 
With this change authentification works...
 
Thanks in advance,
 
-Ken Blackler
 

Received on Tuesday, 16 February 1999 09:07:12 UTC