Mladen Turk wrote:
Rainer Jung wrote:
No problem, better safe than sorry.
Right. It seems I always forget the ingenuity of the users
that wish to extent the http spec :)
However, I think that we can still use the memcmp
with "xxx\0". That would still be faster then figuring out the EOL with
strcmp?
If we knew, that the variable header name we compare, is at least of the
same size, than the constant string, we could keep memcmp and simply
increase the number of bytes to compare by 1, because the variable
header and the string constant are already both 0-terminated.
But the header could be shorter than the constant string. So there was a
second problem with the old code, we eventually compared potentially
uninitialized memory to string constants. Strictly speaking the result
was not defined.
Of course now we could use the string length of the header in the same
more advanced way, as we do for parsing the method names, but I thought
the actual outcome would be much more difficult code for most likely
only little performance improvement.
Regards,
Mladen
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]