It looks like evbuffer_prepend doesn't check for empty, whereas evbuffer_prepend_buffer does this explicitly. This breaks in the example at envoyproxy/envoy#6062. Basically, an empty prepend to an immutable chain entry, followed by a evbuffer_remove_buffer and then evbuffer_add does the wrong thing.
We work around this in Envoy in envoyproxy/envoy#6042 by skipping prepend of empty, I think we could do the same in libevent. However, it would be great to get some expert eyes on this, since there may be a more interesting underlying bug that this is tickling.
It looks like
evbuffer_prependdoesn't check for empty, whereasevbuffer_prepend_bufferdoes this explicitly. This breaks in the example at envoyproxy/envoy#6062. Basically, an empty prepend to an immutable chain entry, followed by aevbuffer_remove_bufferand thenevbuffer_adddoes the wrong thing.We work around this in Envoy in envoyproxy/envoy#6042 by skipping prepend of empty, I think we could do the same in libevent. However, it would be great to get some expert eyes on this, since there may be a more interesting underlying bug that this is tickling.