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

Re: [Libevent-users] evbuffer result string sometimes not right when use func evbuffer_add_reference()



On Thu, Apr 12, 2012 at 5:33 AM, æåå <bit.kevin@xxxxxxxxx> wrote:
> LSB Version: Â Â:core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
> Distributor ID: CentOS
> Description: Â ÂCentOS release 5.4 (Final)
> Release: Â Â Â Â5.4
> Codename: Â Â Â Final
>
> ldd <my exe>:
> libevent-2.0.so.5 => /usr/local/lib/libevent-2.0.so.5 (0x00002b8af3973000)
> libevent_pthreads-2.0.so.5 =>
> /usr/local/lib/libevent_pthreads-2.0.so.5 (0x00002b8af3bb6000)
> libevent_openssl-2.0.so.5 => /usr/local/lib/libevent_openssl-2.0.so.5
> (0x00002b8af3db8000)
>
> use func evbuffer_add_reference(), code tips:
> Â Â Â Â Âevbuffer_add_printf(buf_, "\"detail\":\"");
> Â Â Â Â Âevbuffer_add_reference(buf_, dp->detail, strlen(dp->detail),
> NULL, NULL);
> Â Â Â Â Âevbuffer_add_printf(buf_, "\"");
>
> sometimes result is wrong, especially when the string's length is long.

Do you have a small demonstration program that can reproduce this
issue?  When I try the code above, it seems to work okay for me.

How are you extracting the result strings?

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