[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] Inline modification of evbuffer data
On Tue, Nov 15, 2016 at 9:12 PM, Devi Prasad Ivaturi <divaturi@xxxxxxxxx> wrote:
> How can I modify a byte or two directly in evbuffer data?
Hi,
If you don't want to use pullup, you can use something like (but only
if you data at the beginning of the buffer, otherwise it is like
pullup):
evbuffer_remove(buf, data, bytes);
data[1] = 'x';
evbuffer_prepend(buf, data, bytes);
Or
evbuffer_ptr_evbuffer_search() # but be aware of continuous
But I'm not sure that this is optimal though.
Azat.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.