mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 13:04:23 -04:00
be_openssl: drop close_flag parameter of the BIO_new_bufferevent()
(cherry picked from commit 474d72aeac818198737aa7cb009578c464db11ca)
This commit is contained in:
parent
f3aa6a47fc
commit
83275459c3
@ -250,7 +250,7 @@ BIO_s_bufferevent(void)
|
|||||||
/* Create a new BIO to wrap communication around a bufferevent. If close_flag
|
/* Create a new BIO to wrap communication around a bufferevent. If close_flag
|
||||||
* is true, the bufferevent will be freed when the BIO is closed. */
|
* is true, the bufferevent will be freed when the BIO is closed. */
|
||||||
static BIO *
|
static BIO *
|
||||||
BIO_new_bufferevent(struct bufferevent *bufferevent, int close_flag)
|
BIO_new_bufferevent(struct bufferevent *bufferevent)
|
||||||
{
|
{
|
||||||
BIO *result;
|
BIO *result;
|
||||||
if (!bufferevent)
|
if (!bufferevent)
|
||||||
@ -259,7 +259,9 @@ BIO_new_bufferevent(struct bufferevent *bufferevent, int close_flag)
|
|||||||
return NULL;
|
return NULL;
|
||||||
BIO_set_init(result, 1);
|
BIO_set_init(result, 1);
|
||||||
BIO_set_data(result, bufferevent);
|
BIO_set_data(result, bufferevent);
|
||||||
BIO_set_shutdown(result, close_flag ? 1 : 0);
|
/* We don't tell the BIO to close the bufferevent; we do it ourselves on
|
||||||
|
* be_openssl_destruct() */
|
||||||
|
BIO_set_shutdown(result, 0);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1303,7 +1305,7 @@ be_openssl_ctrl(struct bufferevent *bev,
|
|||||||
SSL_set_bio(bev_ssl->ssl, bio, bio);
|
SSL_set_bio(bev_ssl->ssl, bio, bio);
|
||||||
} else {
|
} else {
|
||||||
BIO *bio;
|
BIO *bio;
|
||||||
if (!(bio = BIO_new_bufferevent(bev_ssl->underlying, 0)))
|
if (!(bio = BIO_new_bufferevent(bev_ssl->underlying)))
|
||||||
return -1;
|
return -1;
|
||||||
SSL_set_bio(bev_ssl->ssl, bio, bio);
|
SSL_set_bio(bev_ssl->ssl, bio, bio);
|
||||||
}
|
}
|
||||||
@ -1407,13 +1409,10 @@ bufferevent_openssl_filter_new(struct event_base *base,
|
|||||||
enum bufferevent_ssl_state state,
|
enum bufferevent_ssl_state state,
|
||||||
int options)
|
int options)
|
||||||
{
|
{
|
||||||
/* We don't tell the BIO to close the bufferevent; we do it ourselves
|
|
||||||
* on be_openssl_destruct */
|
|
||||||
int close_flag = 0; /* options & BEV_OPT_CLOSE_ON_FREE; */
|
|
||||||
BIO *bio;
|
BIO *bio;
|
||||||
if (!underlying)
|
if (!underlying)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!(bio = BIO_new_bufferevent(underlying, close_flag)))
|
if (!(bio = BIO_new_bufferevent(underlying)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
SSL_set_bio(ssl, bio, bio);
|
SSL_set_bio(ssl, bio, bio);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user