Skip to content

Commit 661c5b3

Browse files
committed
State::send_open:Add final_response indicating if more headers will come
1 parent fc7e766 commit 661c5b3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/proto/streams/send.rs

+2-1
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
let mut pending_open = false;
147148
if counts.peer().is_local_init(frame.stream_id()) && !stream.is_pending_push {

src/proto/streams/state.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ enum Cause {
8888

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

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

0 commit comments

Comments
 (0)