]> granicus.if.org Git - libevent/commitdiff
Make evbuffer callbacks get the right n_added value after evbuffer_add
authorNick Mathewson <nickm@torproject.org>
Wed, 28 Sep 2011 13:22:17 +0000 (09:22 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 28 Sep 2011 13:22:17 +0000 (09:22 -0400)
Patch from Alex.

buffer.c

index 98f5a0b2f4364733f119c4ec524803d1b57f18f1..146bbdf43d84d7e3acbc8bb2be65b36ede0f874a 100644 (file)
--- a/buffer.c
+++ b/buffer.c
@@ -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);