Call underlying bev ctrl GET_FD on filtered bufferevents

Fixes: #611
Fixes: #610
(cherry picked from commit 4055081499cba32642dd72427a8f9d3ad7e50e79)
This commit is contained in:
Greg Hazel 2018-03-20 15:12:07 -07:00 committed by Azat Khuzhin
parent 4f0f40e31e
commit ebfac51797
No known key found for this signature in database
GPG Key ID: B86086848EF8686D
2 changed files with 3 additions and 4 deletions

View File

@ -605,6 +605,7 @@ be_filter_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op,
data->ptr = bevf->underlying;
return 0;
case BEV_CTRL_SET_FD:
case BEV_CTRL_GET_FD:
bevf = upcast(bev);
if (bevf->underlying &&
@ -614,8 +615,6 @@ be_filter_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op,
}
EVUTIL_FALLTHROUGH;
case BEV_CTRL_GET_FD:
EVUTIL_FALLTHROUGH;
case BEV_CTRL_CANCEL_ALL:
EVUTIL_FALLTHROUGH;
default:

View File

@ -569,8 +569,8 @@ test_bufferevent_filters_impl(int use_pair, int disable)
tt_ptr_op(bufferevent_get_underlying(bev1), ==, bev1_base);
tt_ptr_op(bufferevent_get_underlying(bev2), ==, bev2_base);
tt_int_op(bufferevent_getfd(bev1), ==, -1);
tt_int_op(bufferevent_getfd(bev2), ==, -1);
tt_int_op(bufferevent_getfd(bev1), ==, bufferevent_getfd(bev1_base));
tt_int_op(bufferevent_getfd(bev2), ==, bufferevent_getfd(bev2_base));
bufferevent_disable(bev1, EV_READ);
bufferevent_enable(bev2, EV_READ);