Skip to content

Commit 9dde7e1

Browse files
committed
State::send_open:Add final_response indicating if more headers will come
1 parent 657bcb4 commit 9dde7e1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/proto/streams/send.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,11 @@ impl Send {
138138

139139
Self::check_headers(frame.fields())?;
140140

141+
let final_response = !frame.is_informational();
141142
let end_stream = frame.is_end_stream();
142143

143144
// Update the state
144-
stream.state.send_open(end_stream)?;
145+
stream.state.send_open(final_response, end_stream)?;
145146

146147
if counts.peer().is_local_init(frame.stream_id()) {
147148
// If we're waiting on a PushPromise anyway

src/proto/streams/state.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,12 @@ enum Cause {
8787

8888
impl State {
8989
/// Opens the send-half of a stream if it is not already open.
90-
pub fn send_open(&mut self, eos: bool) -> Result<(), UserError> {
91-
let local = Streaming;
90+
pub fn send_open(&mut self, final_response: bool, eos: bool) -> Result<(), UserError> {
91+
let local = if final_response {
92+
Streaming
93+
} else {
94+
AwaitingHeaders
95+
};
9296

9397
self.inner = match self.inner {
9498
Idle => {

0 commit comments

Comments
 (0)