Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions proxy/http2/Http2ConnectionState.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1677,6 +1677,8 @@ Http2ConnectionState::send_a_data_frame(Http2Stream *stream, size_t &payload_len
payload_length = 0;
}

stream->update_sent_count(payload_length);
Comment thread
masaori335 marked this conversation as resolved.

// Are we at the end?
// If we return here, we never send the END_STREAM in the case of a early terminating OS.
// OK if there is no body yet. Otherwise continue on to send a DATA frame and delete the stream
Expand All @@ -1686,7 +1688,7 @@ Http2ConnectionState::send_a_data_frame(Http2Stream *stream, size_t &payload_len
return Http2SendDataFrameResult::NO_PAYLOAD;
}

if (stream->is_write_vio_done() && !resp_reader->is_read_avail_more_than(0)) {
if (stream->is_write_vio_done()) {
flags |= HTTP2_FLAGS_DATA_END_STREAM;
}

Expand All @@ -1701,8 +1703,6 @@ Http2ConnectionState::send_a_data_frame(Http2Stream *stream, size_t &payload_len
Http2DataFrame data(stream->get_id(), flags, resp_reader, payload_length);
this->ua_session->xmit(data, flags & HTTP2_FLAGS_DATA_END_STREAM);

stream->update_sent_count(payload_length);

if (flags & HTTP2_FLAGS_DATA_END_STREAM) {
Http2StreamDebug(ua_session, stream->get_id(), "END_STREAM");
stream->send_end_stream = true;
Expand Down