summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bufferevent_filter.c5
-rw-r--r--bufferevent_openssl.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/bufferevent_filter.c b/bufferevent_filter.c
index 0608f4a4..0287803c 100644
--- a/bufferevent_filter.c
+++ b/bufferevent_filter.c
@@ -233,8 +233,9 @@ be_filter_destruct(struct bufferevent *bev)
}
} else {
if (bevf->underlying) {
- bufferevent_setcb(bevf->underlying,
- NULL, NULL, NULL, NULL);
+ if (bevf->underlying->errorcb == be_filter_eventcb)
+ bufferevent_setcb(bevf->underlying,
+ NULL, NULL, NULL, NULL);
bufferevent_unsuspend_read(bevf->underlying,
BEV_SUSPEND_FILT_READ);
}
diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c
index 46a39275..e9a812d0 100644
--- a/bufferevent_openssl.c
+++ b/bufferevent_openssl.c
@@ -1090,8 +1090,9 @@ be_openssl_destruct(struct bufferevent *bev)
SSL_free(bev_ssl->ssl);
} else {
if (bev_ssl->underlying) {
- bufferevent_setcb(bev_ssl->underlying,
- NULL,NULL,NULL,NULL);
+ if (bev_ssl->underlying->errorcb == be_openssl_eventcb)
+ bufferevent_setcb(bev_ssl->underlying,
+ NULL,NULL,NULL,NULL);
bufferevent_unsuspend_read(bev_ssl->underlying,
BEV_SUSPEND_FILT_READ);
}