Fix n_add_for_cb in evbuffer_prepend() in case of new buffer required

Signed-off-by: @luoming1224
Fixes: #349
This commit is contained in:
Azat Khuzhin 2016-04-21 01:58:58 +03:00
parent b8d7c6211a
commit 0abd0393ea

View File

@ -1883,7 +1883,7 @@ evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen)
memcpy(tmp->buffer + tmp->misalign, data, datlen);
buf->total_len += datlen;
buf->n_add_for_cb += (size_t)chain->misalign;
buf->n_add_for_cb += datlen;
out:
evbuffer_invoke_callbacks_(buf);