Only clear underlying callbacks when the user hasn't reset them.

This commit is contained in:
Nick Mathewson 2010-11-09 15:18:59 -05:00
parent fc7b1b005c
commit 1ac5b2303a
2 changed files with 6 additions and 4 deletions

View File

@ -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);
}

View File

@ -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);
}