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
This commit is contained in:
Azat Khuzhin 2018-11-08 00:36:07 +03:00
parent 9afe7a6c12
commit 1fc1c7ef1d
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

View File

@ -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): "