File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ macro_rules! limited_write_buf {
23
23
pub struct FramedWrite < T , B > {
24
24
/// Upstream `AsyncWrite`
25
25
inner : T ,
26
+ final_flush_done : bool ,
26
27
27
28
encoder : Encoder < B > ,
28
29
}
89
90
} ;
90
91
FramedWrite {
91
92
inner,
93
+ final_flush_done : false ,
92
94
encoder : Encoder {
93
95
hpack : hpack:: Encoder :: default ( ) ,
94
96
buf : Cursor :: new ( BytesMut :: with_capacity ( DEFAULT_BUFFER_CAPACITY ) ) ,
@@ -165,7 +167,10 @@ where
165
167
166
168
/// Close the codec
167
169
pub fn shutdown ( & mut self , cx : & mut Context ) -> Poll < io:: Result < ( ) > > {
168
- ready ! ( self . flush( cx) ) ?;
170
+ if !self . final_flush_done {
171
+ ready ! ( self . flush( cx) ) ?;
172
+ self . final_flush_done = true ;
173
+ }
169
174
Pin :: new ( & mut self . inner ) . poll_shutdown ( cx)
170
175
}
171
176
}
You can’t perform that action at this time.
0 commit comments