We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Upgraded
1 parent 9a113ed commit be08648Copy full SHA for be08648
src/proto/h2/mod.rs
@@ -377,9 +377,24 @@ where
377
378
fn poll_shutdown(
379
mut self: Pin<&mut Self>,
380
- _cx: &mut Context<'_>,
+ cx: &mut Context<'_>,
381
) -> Poll<Result<(), io::Error>> {
382
- Poll::Ready(self.send_stream.write(&[], true))
+ if self.send_stream.write(&[], true).is_ok() {
383
+ return Poll::Ready(Ok(()))
384
+ }
385
+
386
+ Poll::Ready(Err(h2_to_io_error(
387
+ match ready!(self.send_stream.poll_reset(cx)) {
388
+ Ok(Reason::NO_ERROR) => {
389
390
391
+ Ok(Reason::CANCEL) | Ok(Reason::STREAM_CLOSED) => {
392
+ return Poll::Ready(Err(io::ErrorKind::BrokenPipe.into()))
393
394
+ Ok(reason) => reason.into(),
395
+ Err(e) => e,
396
+ },
397
+ )))
398
}
399
400
0 commit comments