nghttpx: Extend Downstream stream_id to 64 bits

This commit is contained in:
Tatsuhiro Tsujikawa 2021-08-16 22:49:00 +09:00
parent 544882ca0e
commit 204b3884d1
2 changed files with 17 additions and 17 deletions

View File

@ -113,7 +113,7 @@ void downstream_wtimeoutcb(struct ev_loop *loop, ev_timer *w, int revents) {
// upstream could be nullptr for unittests // upstream could be nullptr for unittests
Downstream::Downstream(Upstream *upstream, MemchunkPool *mcpool, Downstream::Downstream(Upstream *upstream, MemchunkPool *mcpool,
int32_t stream_id) int64_t stream_id)
: dlnext(nullptr), : dlnext(nullptr),
dlprev(nullptr), dlprev(nullptr),
response_sent_body_length(0), response_sent_body_length(0),
@ -605,9 +605,9 @@ void Downstream::reset_upstream(Upstream *upstream) {
Upstream *Downstream::get_upstream() const { return upstream_; } Upstream *Downstream::get_upstream() const { return upstream_; }
void Downstream::set_stream_id(int32_t stream_id) { stream_id_ = stream_id; } void Downstream::set_stream_id(int64_t stream_id) { stream_id_ = stream_id; }
int32_t Downstream::get_stream_id() const { return stream_id_; } int64_t Downstream::get_stream_id() const { return stream_id_; }
void Downstream::set_request_state(DownstreamState state) { void Downstream::set_request_state(DownstreamState state) {
request_state_ = state; request_state_ = state;
@ -904,11 +904,11 @@ StringRef Downstream::get_http2_settings() const {
return http2_settings->value; return http2_settings->value;
} }
void Downstream::set_downstream_stream_id(int32_t stream_id) { void Downstream::set_downstream_stream_id(int64_t stream_id) {
downstream_stream_id_ = stream_id; downstream_stream_id_ = stream_id;
} }
int32_t Downstream::get_downstream_stream_id() const { int64_t Downstream::get_downstream_stream_id() const {
return downstream_stream_id_; return downstream_stream_id_;
} }
@ -1115,11 +1115,11 @@ DefaultMemchunks Downstream::pop_response_buf() {
return std::move(response_buf_); return std::move(response_buf_);
} }
void Downstream::set_assoc_stream_id(int32_t stream_id) { void Downstream::set_assoc_stream_id(int64_t stream_id) {
assoc_stream_id_ = stream_id; assoc_stream_id_ = stream_id;
} }
int32_t Downstream::get_assoc_stream_id() const { return assoc_stream_id_; } int64_t Downstream::get_assoc_stream_id() const { return assoc_stream_id_; }
BlockAllocator &Downstream::get_block_allocator() { return balloc_; } BlockAllocator &Downstream::get_block_allocator() { return balloc_; }

View File

@ -319,20 +319,20 @@ enum class DispatchState {
class Downstream { class Downstream {
public: public:
Downstream(Upstream *upstream, MemchunkPool *mcpool, int32_t stream_id); Downstream(Upstream *upstream, MemchunkPool *mcpool, int64_t stream_id);
~Downstream(); ~Downstream();
void reset_upstream(Upstream *upstream); void reset_upstream(Upstream *upstream);
Upstream *get_upstream() const; Upstream *get_upstream() const;
void set_stream_id(int32_t stream_id); void set_stream_id(int64_t stream_id);
int32_t get_stream_id() const; int64_t get_stream_id() const;
void set_assoc_stream_id(int32_t stream_id); void set_assoc_stream_id(int64_t stream_id);
int32_t get_assoc_stream_id() const; int64_t get_assoc_stream_id() const;
void pause_read(IOCtrlReason reason); void pause_read(IOCtrlReason reason);
int resume_read(IOCtrlReason reason, size_t consumed); int resume_read(IOCtrlReason reason, size_t consumed);
void force_resume_read(); void force_resume_read();
// Set stream ID for downstream HTTP2 connection. // Set stream ID for downstream HTTP2 connection.
void set_downstream_stream_id(int32_t stream_id); void set_downstream_stream_id(int64_t stream_id);
int32_t get_downstream_stream_id() const; int64_t get_downstream_stream_id() const;
int attach_downstream_connection(std::unique_ptr<DownstreamConnection> dconn); int attach_downstream_connection(std::unique_ptr<DownstreamConnection> dconn);
void detach_downstream_connection(); void detach_downstream_connection();
@ -566,12 +566,12 @@ private:
// How many times we tried in backend connection // How many times we tried in backend connection
size_t num_retry_; size_t num_retry_;
// The stream ID in frontend connection // The stream ID in frontend connection
int32_t stream_id_; int64_t stream_id_;
// The associated stream ID in frontend connection if this is pushed // The associated stream ID in frontend connection if this is pushed
// stream. // stream.
int32_t assoc_stream_id_; int64_t assoc_stream_id_;
// stream ID in backend connection // stream ID in backend connection
int32_t downstream_stream_id_; int64_t downstream_stream_id_;
// RST_STREAM error_code from downstream HTTP2 connection // RST_STREAM error_code from downstream HTTP2 connection
uint32_t response_rst_stream_error_code_; uint32_t response_rst_stream_error_code_;
// An affinity cookie value. // An affinity cookie value.