Make evbuffer callbacks get the right n_added value after evbuffer_add

Patch from Alex.
This commit is contained in:
Nick Mathewson 2011-09-28 09:22:17 -04:00
parent 296d29a12c
commit 1ef1f68462

View File

@ -1557,6 +1557,7 @@ evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen)
memcpy(tmp->buffer, data, datlen);
tmp->off = datlen;
evbuffer_chain_insert(buf, tmp);
buf->n_add_for_cb += datlen;
out:
evbuffer_invoke_callbacks(buf);