nghttpx: Call upstream resume_read after sending pending request to backend
With the combination of HTTP/1 upstream and HTTP/2 downstream, downstream tells SHRPX_NO_BUFFER while connecting to the backend server. Previously, we did not call upstream resume_read and upload was blocked. This commit now calls upstream resume_read to unblock. This commit also remove pending output buffer size of Http2Session when calculating downstream connection's buffer is full. This is desirable since we only operate resume_read by stream basis.
This commit is contained in:
parent
e4751a798a
commit
5bff48a15a
|
@ -583,7 +583,7 @@ StreamData* Http2DownstreamConnection::detach_stream_data()
|
||||||
bool Http2DownstreamConnection::get_output_buffer_full()
|
bool Http2DownstreamConnection::get_output_buffer_full()
|
||||||
{
|
{
|
||||||
if(request_body_buf_) {
|
if(request_body_buf_) {
|
||||||
return http2session_->get_outbuf_length() +
|
return
|
||||||
evbuffer_get_length(request_body_buf_) >= Http2Session::OUTBUF_MAX_THRES;
|
evbuffer_get_length(request_body_buf_) >= Http2Session::OUTBUF_MAX_THRES;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1471,6 +1471,9 @@ int Http2Session::on_connect()
|
||||||
// submit pending request
|
// submit pending request
|
||||||
for(auto dconn : dconns_) {
|
for(auto dconn : dconns_) {
|
||||||
if(dconn->push_request_headers() == 0) {
|
if(dconn->push_request_headers() == 0) {
|
||||||
|
auto downstream = dconn->get_downstream();
|
||||||
|
auto upstream = downstream->get_upstream();
|
||||||
|
upstream->resume_read(SHRPX_NO_BUFFER, downstream, 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue