From 1fc1c7ef1dabbbb358b99b893712bccc5761f82d Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Thu, 8 Nov 2018 00:36:07 +0300 Subject: [PATCH] regress_ssl: fix ssl/bufferevent_wm_filter for non defered callbacks Even after referenced patch there is still possible recursive callbacks from evbuffer_drain(bev_input), i.e.: wm_transfer() -> evbuffer_drain() -> wm_transfer() inc(ctx->get) But if we will increment ctx->get before drain that we will not add more data to buffer. Refs: 54c6fe3c ("regress_ssl: make ssl/bufferevent_wm_filter more fault-tolerance") CI: https://ci.appveyor.com/project/nmathewson/libevent/build/job/f0rv299i71wnuxdq#L2546 --- test/regress_ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/regress_ssl.c b/test/regress_ssl.c index 88010a92..45ce540d 100644 --- a/test/regress_ssl.c +++ b/test/regress_ssl.c @@ -822,8 +822,8 @@ wm_transfer(struct bufferevent *bev, void *arg) bufferevent_setcb(bev, NULL, NULL, NULL, NULL); bufferevent_disable(bev, EV_READ); } else { - evbuffer_drain(in, drain); ctx->get += drain; + evbuffer_drain(in, drain); } TT_BLATHER(("wm_transfer-%s(%p): "