diff --git a/src/shrpx_connection.cc b/src/shrpx_connection.cc index b6c5b648..891ad60a 100644 --- a/src/shrpx_connection.cc +++ b/src/shrpx_connection.cc @@ -293,13 +293,13 @@ void delete_bio_method(BIO_METHOD *bio_method) { BIO_meth_free(bio_method); } #else // !OPENSSL_1_1_API BIO_METHOD *create_bio_method() { - static BIO_METHOD shrpx_bio_method = { + static auto meth = new BIO_METHOD{ BIO_TYPE_FD, "nghttpx-bio", shrpx_bio_write, shrpx_bio_read, shrpx_bio_puts, shrpx_bio_gets, shrpx_bio_ctrl, shrpx_bio_create, shrpx_bio_destroy, }; - return &shrpx_bio_method; + return meth; } void delete_bio_method(BIO_METHOD *bio_method) {} diff --git a/src/shrpx_connection.h b/src/shrpx_connection.h index 990a85ed..e4800a98 100644 --- a/src/shrpx_connection.h +++ b/src/shrpx_connection.h @@ -161,9 +161,7 @@ struct Connection { ev_tstamp read_timeout; }; -// Creates BIO_method shared by all SSL objects. If nghttp2 is built -// with OpenSSL < 1.1.0, this returns statically allocated object. -// Otherwise, it returns new BIO_METHOD object every time. +// Creates BIO_method shared by all SSL objects. BIO_METHOD *create_bio_method(); // Deletes given |bio_method|. If nghttp2 is built with OpenSSL <