From 92cc0b9c3db38088f79c5d1e432c429fbc366968 Mon Sep 17 00:00:00 2001 From: Dominic Chen Date: Thu, 13 Apr 2017 14:58:13 -0400 Subject: bufferevent: refactor to use type check macros --- bufferevent_openssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bufferevent_openssl.c') diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c index da3963af..252627ec 100644 --- a/bufferevent_openssl.c +++ b/bufferevent_openssl.c @@ -354,11 +354,11 @@ static inline struct bufferevent_openssl * upcast(struct bufferevent *bev) { struct bufferevent_openssl *bev_o; - if (bev->be_ops != &bufferevent_ops_openssl) + if (!BEV_IS_OPENSSL(bev)) return NULL; bev_o = (void*)( ((char*)bev) - evutil_offsetof(struct bufferevent_openssl, bev.bev)); - EVUTIL_ASSERT(bev_o->bev.bev.be_ops == &bufferevent_ops_openssl); + EVUTIL_ASSERT(BEV_IS_OPENSSL(&bev_o->bev.bev)); return bev_o; } @@ -803,7 +803,7 @@ consider_reading(struct bufferevent_openssl *bev_ssl) if (bev_ssl->bev.read_suspended) break; - + /* Read all pending data. This won't hit the network * again, and will (most importantly) put us in a state * where we don't need to read anything else until the -- cgit v1.2.1