Commit 4877f72a authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Optimize a bit

parent 274b3a22
...@@ -208,9 +208,9 @@ int Http2Session::disconnect(bool hard) { ...@@ -208,9 +208,9 @@ int Http2Session::disconnect(bool hard) {
// this object. In order to achieve this, we first swap dconns_ and // this object. In order to achieve this, we first swap dconns_ and
// streams_. Upstream::on_downstream_reset() may add // streams_. Upstream::on_downstream_reset() may add
// Http2DownstreamConnection. // Http2DownstreamConnection.
std::set<Http2DownstreamConnection *> dconns; std::unordered_set<Http2DownstreamConnection *> dconns;
dconns.swap(dconns_); dconns.swap(dconns_);
std::set<StreamData *> streams; std::unordered_set<StreamData *> streams;
streams.swap(streams_); streams.swap(streams_);
std::set<ClientHandler *> handlers; std::set<ClientHandler *> handlers;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "shrpx.h" #include "shrpx.h"
#include <set> #include <unordered_set>
#include <memory> #include <memory>
#include <openssl/ssl.h> #include <openssl/ssl.h>
...@@ -188,8 +188,8 @@ private: ...@@ -188,8 +188,8 @@ private:
// connection check has started, this timer is started again and // connection check has started, this timer is started again and
// traps PING ACK timeout. // traps PING ACK timeout.
ev_timer connchk_timer_; ev_timer connchk_timer_;
std::set<Http2DownstreamConnection *> dconns_; std::unordered_set<Http2DownstreamConnection *> dconns_;
std::set<StreamData *> streams_; std::unordered_set<StreamData *> streams_;
std::function<int(Http2Session &)> read_, write_; std::function<int(Http2Session &)> read_, write_;
std::function<int(Http2Session &)> on_read_, on_write_; std::function<int(Http2Session &)> on_read_, on_write_;
// Used to parse the response from HTTP proxy // Used to parse the response from HTTP proxy
......
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