[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Off by one error in HTTP message handling or documentation error



On Mon, Apr 11, 2011 at 10:06 AM, Oscar Koeroo <okoeroo@xxxxxxxxx> wrote:
> Hello,

Hi, and sorry about the delay!

> When looking at the evbuffer_add() docs, like here:
> http://monkey.org/~provos/libevent/doxygen-2.0.1/buffer_8h.html#69c3b8893a49bdd919642c6920c1fcb4
>
> the doc doesn't seem to state that I need to include the '\0' into the
> buffer. Perhaps the documentation is OK, and I should have been able to
> exclude the '\0' from being included in the buffer. In that latter case I
> would look for a bug in the code region that is assembling the HTTP request
> messages that go over the wire.
>
> Bottomline:
> Did I initially use it wrongly? If so, please state in the docs that I
> should have included the '\0'. Did I stumble upon an error?

evbuffer_add() definitely doesn't require nul-terminated strings.  You
only need to add a nul to the buffer if you actually want a nul onto
the buffer...

...but if *not* sending NUL to an http server is making it freak out,
then yes, there is probably a bug someplace.  If you can write a
minimal test-program to demonstrate, that would help a lot in
diagnosing and debugging.

cheers,
-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.