[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
- To: libevent-users@xxxxxxxxxxxxx
- Subject: Re: [Libevent-users] Off by one error in HTTP message handling or documentation error
- From: Nick Mathewson <nickm@xxxxxxxxxxxxx>
- Date: Fri, 6 May 2011 23:46:13 -0400
- Cc: libevent-users <libevent-users@xxxxxxxx>
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Fri, 06 May 2011 23:46:25 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=xHtbEqDlE3KsMtYE3w/gt4BEFuFP5jnWyQEwU7x+Us4=; b=B8/9xPjSU1YyeiTbDikH4cU9D178dYiPq3x4z5f8z3ic7C/Wu3KT5QpedqHVWJoJCS gzBd05RvQ+4TVLnmMGUOnnHzkfaBfeF0biDiv0l/3WhJi9KxX/nKMLjfldh0Q/SteSUj h55e2qjlHHNSG8p1BmfUwYvBVkpowMhf0IZNI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=xBbWEoAp7VNW4OT8EXbhCybNynEB3U9Kh4V1PKYSGmcX/W0s+S5iZznWa9+HXDAqjf uHSQbmkiyVnWAUJdsM0Yn1oLsCIvbYvqci4rN/osyZmcDPoyp7ZWo7lEbbbpmP+OqAxq kHUhd4W2lfUHIhmFm9EG1GCeOQj12Qg/lF/rA=
- In-reply-to: <4DA30AE2.6090004@xxxxxxxxx>
- References: <4DA30AE2.6090004@xxxxxxxxx>
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
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.