nghttpx: Use std::vector instead of raw array

This commit is contained in:
Tatsuhiro Tsujikawa 2014-06-27 00:26:21 +09:00
parent 451c7d957d
commit 68cd12ac29
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -31,6 +31,7 @@
#include <sys/socket.h>
#include <memory>
#include <vector>
#include <openssl/ssl.h>
@ -58,12 +59,12 @@ public:
event_base* get_evbase() const;
int create_http2_session();
private:
std::vector<WorkerInfo> 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_;