Commit ddfa93ff authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Make socketpair in internal use non-block

parent a61ca763
...@@ -196,6 +196,8 @@ int Http2Session::init_notification() ...@@ -196,6 +196,8 @@ int Http2Session::init_notification()
SSLOG(FATAL, this) << "socketpair() failed: errno=" << errno; SSLOG(FATAL, this) << "socketpair() failed: errno=" << errno;
return -1; return -1;
} }
evutil_make_socket_nonblocking(sockpair[0]);
evutil_make_socket_nonblocking(sockpair[1]);
wrbev_ = bufferevent_socket_new(evbase_, sockpair[0], wrbev_ = bufferevent_socket_new(evbase_, sockpair[0],
BEV_OPT_CLOSE_ON_FREE| BEV_OPT_CLOSE_ON_FREE|
BEV_OPT_DEFER_CALLBACKS); BEV_OPT_DEFER_CALLBACKS);
......
...@@ -67,6 +67,8 @@ void ListenHandler::create_worker_thread(size_t num) ...@@ -67,6 +67,8 @@ void ListenHandler::create_worker_thread(size_t num)
LLOG(ERROR, this) << "socketpair() failed: errno=" << errno; LLOG(ERROR, this) << "socketpair() failed: errno=" << errno;
continue; continue;
} }
evutil_make_socket_nonblocking(info->sv[0]);
evutil_make_socket_nonblocking(info->sv[1]);
info->sv_ssl_ctx = sv_ssl_ctx_; info->sv_ssl_ctx = sv_ssl_ctx_;
info->cl_ssl_ctx = cl_ssl_ctx_; info->cl_ssl_ctx = cl_ssl_ctx_;
try { try {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment