File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,16 +39,31 @@ where
3939 return Err ( Error :: Io ( err) ) ;
4040 }
4141 }
42+ #[ cfg( feature = "http1" ) ]
4243 Err ( Error :: H1 ( crate :: h1:: Error :: Io ( err) ) ) => {
4344 if err. kind ( ) != io:: ErrorKind :: UnexpectedEof {
4445 return Err ( Error :: H1 ( crate :: h1:: Error :: Io ( err) ) ) ;
4546 }
4647 }
48+ #[ cfg( feature = "http2" ) ]
49+ Err ( Error :: H2 ( crate :: h2:: Error :: H2 ( err) ) ) => {
50+ if !err. is_go_away ( ) {
51+ return Err ( Error :: H2 ( crate :: h2:: Error :: H2 ( err) ) ) ;
52+ }
53+
54+ let reason = err. reason ( ) . unwrap ( ) ;
55+
56+ if reason != h2:: Reason :: NO_ERROR {
57+ return Err ( Error :: H2 ( crate :: h2:: Error :: H2 ( err) ) ) ;
58+ }
59+ }
60+ #[ cfg( feature = "http2" ) ]
4761 Err ( Error :: H2 ( crate :: h2:: Error :: Io ( err) ) ) => {
4862 if err. kind ( ) != io:: ErrorKind :: UnexpectedEof {
4963 return Err ( Error :: H2 ( crate :: h2:: Error :: Io ( err) ) ) ;
5064 }
5165 }
66+ #[ cfg( feature = "http3" ) ]
5267 Err ( Error :: H3 ( crate :: h3:: Error :: Io ( err) ) ) => {
5368 if err. kind ( ) != io:: ErrorKind :: UnexpectedEof {
5469 return Err ( Error :: H3 ( crate :: h3:: Error :: Io ( err) ) ) ;
You can’t perform that action at this time.
0 commit comments