]> granicus.if.org Git - libevent/commitdiff
Make default (nil) filter use evbuffer_remove_buffer to respect the high-water mark...
authorNick Mathewson <nickm@torproject.org>
Tue, 10 Feb 2009 19:39:12 +0000 (19:39 +0000)
committerNick Mathewson <nickm@torproject.org>
Tue, 10 Feb 2009 19:39:12 +0000 (19:39 +0000)
svn:r1109

bufferevent_filter.c

index d16d2a30b86c4e15242340b2cef176f7d8f655e7..e8e1f6f555b1aeb6e16508d079c0a65d1807ccc1 100644 (file)
@@ -154,10 +154,8 @@ static enum bufferevent_filter_result
 be_null_filter(struct evbuffer *src, struct evbuffer *dst, ssize_t lim,
               enum bufferevent_flush_mode state, void *ctx)
 {
-        /* XXX respect lim. */
-
        (void)state;
-       if (evbuffer_add_buffer(dst, src) == 0)
+       if (evbuffer_remove_buffer(src, src, lim) == 0)
                return BEV_OK;
        else
                return BEV_ERROR;