diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index 1dafe4d5..ba90be79 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -902,9 +902,9 @@ void ClientHandler::write_accesslog(int major, int minor, unsigned int status, WorkerStat *ClientHandler::get_worker_stat() const { return worker_stat_; } -UpstreamBuf *ClientHandler::get_wb() { return &wb_; } +ClientHandler::WriteBuf *ClientHandler::get_wb() { return &wb_; } -UpstreamBuf *ClientHandler::get_rb() { return &rb_; } +ClientHandler::ReadBuf *ClientHandler::get_rb() { return &rb_; } void ClientHandler::signal_write() { wlimit_.startw(); } diff --git a/src/shrpx_client_handler.h b/src/shrpx_client_handler.h index 2c3efb79..04f161a8 100644 --- a/src/shrpx_client_handler.h +++ b/src/shrpx_client_handler.h @@ -48,8 +48,6 @@ class ConnectBlocker; class DownstreamConnectionPool; struct WorkerStat; -typedef RingBuf<65536> UpstreamBuf; - class ClientHandler { public: ClientHandler(struct ev_loop *loop, int fd, SSL *ssl, const char *ipaddr, @@ -137,8 +135,11 @@ public: int64_t body_bytes_sent); WorkerStat *get_worker_stat() const; - UpstreamBuf *get_wb(); - UpstreamBuf *get_rb(); + using WriteBuf = RingBuf<65536>; + using ReadBuf = RingBuf<8192>; + + WriteBuf *get_wb(); + ReadBuf *get_rb(); RateLimit *get_rlimit(); RateLimit *get_wlimit(); @@ -176,8 +177,8 @@ private: bool should_close_after_write_; bool tls_handshake_; bool tls_renegotiation_; - UpstreamBuf wb_; - UpstreamBuf rb_; + WriteBuf wb_; + ReadBuf rb_; }; } // namespace shrpx diff --git a/src/shrpx_http2_session.h b/src/shrpx_http2_session.h index d575c232..422f876d 100644 --- a/src/shrpx_http2_session.h +++ b/src/shrpx_http2_session.h @@ -52,8 +52,6 @@ struct StreamData { class Http2Session { public: - typedef RingBuf<65536> Buf; - Http2Session(struct ev_loop *loop, SSL_CTX *ssl_ctx); ~Http2Session(); @@ -170,6 +168,9 @@ public: CONNECTION_CHECK_STARTED }; + using ReadBuf = RingBuf<8192>; + using WriteBuf = RingBuf<65536>; + private: ev_io wev_; ev_io rev_; @@ -200,8 +201,8 @@ private: int connection_check_state_; bool flow_control_; bool write_requested_; - Buf wb_; - Buf rb_; + WriteBuf wb_; + ReadBuf rb_; }; } // namespace shrpx