nghttpx: Use smaller buffer for reading

This commit is contained in:
Tatsuhiro Tsujikawa 2015-01-08 21:28:52 +09:00
parent a41b7baf81
commit 5473e870eb
3 changed files with 14 additions and 12 deletions

View File

@ -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(); }

View File

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

View File

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