From a8769ef12d7e223e33fc47bed03fba2bfa2f3536 Mon Sep 17 00:00:00 2001 From: Marcus Sundberg Date: Sat, 26 Mar 2016 20:11:43 +0100 Subject: [PATCH] evbuffer_add: Use last_with_datap if set, not last. evbuffer_add() would always put data in the last chain, even if there was available space in a previous chain, and in doing so it also failed to update last_with_datap, causing subsequent calls to other functions that do look at last_with_datap to add data in the middle of the evbuffer instead of at the end. Fixes the evbuffer_add() part of issue #335, and the evbuffer/add2 and evbuffer/add3 tests, and also prevents wasting space available in the chain pointed to by last_with_datap. --- buffer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/buffer.c b/buffer.c index 7cca0e8a..f378b731 100644 --- a/buffer.c +++ b/buffer.c @@ -1732,7 +1732,11 @@ evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen) goto done; } - chain = buf->last; + if (*buf->last_with_datap == NULL) { + chain = buf->last; + } else { + chain = *buf->last_with_datap; + } /* If there are no chains allocated for this buffer, allocate one * big enough to hold all the data. */ -- 2.12.0 m?id=6098a386a90f63fc8c6f18c5edfce15320789941'>treecommitdiff
path: root/gnu/packages/datastructures.scm
AgeCommit message (Expand)Author
2017-12-12gnu: Add uthash....* gnu/packages/datastructures.scm (uthash): New public variable. Tobias Geerinckx-Rice
2017-06-15gnu: liburcu: Update to 0.10.0....* gnu/packages/databases.scm (liburcu): Update to 0.10.0. Tobias Geerinckx-Rice
2017-04-17gnu: Fix typos in descriptions....* gnu/packages/admin.scm (di)[description]: Likewise. * gnu/packages/bioinformatics.scm (r-annotate)[description]: Likewise. * gnu/packages/datastructures.scm (sparsehash)[description]: Likewise. * gnu/packages/dns.scm (knot)[description]: Likewise. * gnu/packages/emacs.scm (emacs-idle-highlight)[synopsis, description]: Likewise. * gnu/packages/gnome.scm (libpeas)[description]: Likewise. * gnu/packages/gtk.scm (python2-pygtk)[description]: Likewise. * gnu/packages/kde-frameworks.scm (kactivities)[description]: Fix typo. * gnu/packages/libevent.scm (perl-anyevent)[description]: Likewise. * gnu/packages/machine-learning.scm (ghmm)[description]: Likewise. * gnu/packages/mail.scm (mlmmj)[description]: Likewise. * gnu/packages/maths.scm (vc)[description]: Likewise. * gnu/packages/music.scm (gx-super-fuzz-lv2)[description]: Likewise. * gnu/packages/networking.scm (nload)[description]: Likewise. * gnu/packages/python.scm (python-execnet)[description]: Likewise. * gnu/packages/terminals.scm (tilda)[description]: Likewise. * gnu/packages/python.scm (python-execnet, python-tables) (python2-coverage-test-runner, python2-rope)[description]: Likewise. Tobias Geerinckx-Rice
2017-03-17gnu: Add liburcu....* gnu/packages/datastructures.scm (liburcu): New variable. Tobias Geerinckx-Rice
2016-07-19gnu: Add ssdeep....* gnu/packages/datastructures.scm (ssdeep): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Tobias Geerinckx-Rice
2016-03-01gnu: Add gdsl....* gnu/packages/datastructures.scm (gdsl): New variable. Ricardo Wurmus