diff --git a/src/shrpx_listen_handler.cc b/src/shrpx_listen_handler.cc index ef158c0c..4fa7bab9 100644 --- a/src/shrpx_listen_handler.cc +++ b/src/shrpx_listen_handler.cc @@ -49,7 +49,6 @@ ListenHandler::ListenHandler(event_base *evbase, SSL_CTX *sv_ssl_ctx, : evbase_(evbase), sv_ssl_ctx_(sv_ssl_ctx), cl_ssl_ctx_(cl_ssl_ctx), - workers_(nullptr), http2session_(nullptr), rate_limit_group_(bufferevent_rate_limit_group_new (evbase, get_config()->worker_rate_limit_cfg)), @@ -65,7 +64,7 @@ ListenHandler::~ListenHandler() void ListenHandler::create_worker_thread(size_t num) { - workers_ = new WorkerInfo[num]; + workers_.resize(num); num_worker_ = 0; for(size_t i = 0; i < num; ++i) { int rv; diff --git a/src/shrpx_listen_handler.h b/src/shrpx_listen_handler.h index 0d8e5a60..5b99cf81 100644 --- a/src/shrpx_listen_handler.h +++ b/src/shrpx_listen_handler.h @@ -31,6 +31,7 @@ #include #include +#include #include @@ -58,12 +59,12 @@ public: event_base* get_evbase() const; int create_http2_session(); private: + std::vector workers_; event_base *evbase_; // The frontend server SSL_CTX SSL_CTX *sv_ssl_ctx_; // The backend server SSL_CTX SSL_CTX *cl_ssl_ctx_; - WorkerInfo *workers_; // Shared backend HTTP2 session. NULL if multi-threaded. In // multi-threaded case, see shrpx_worker.cc. Http2Session *http2session_;