File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed
Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -811,25 +811,41 @@ mod native_tls_conn {
811811
812812 impl Connection for NativeTlsConn < TokioIo < TokioIo < TcpStream > > > {
813813 fn connected ( & self ) -> Connected {
814- self . inner
814+ let connected = self
815+ . inner
815816 . inner ( )
816817 . get_ref ( )
817818 . get_ref ( )
818819 . get_ref ( )
819820 . inner ( )
820- . connected ( )
821+ . connected ( ) ;
822+ #[ cfg( feature = "native-tls-alpn" ) ]
823+ match self . inner . inner ( ) . get_ref ( ) . negotiated_alpn ( ) . ok ( ) {
824+ Some ( Some ( alpn_protocol) ) if alpn_protocol == b"h2" => connected. negotiated_h2 ( ) ,
825+ _ => connected,
826+ }
827+ #[ cfg( not( feature = "native-tls-alpn" ) ) ]
828+ connected
821829 }
822830 }
823831
824832 impl Connection for NativeTlsConn < TokioIo < MaybeHttpsStream < TokioIo < TcpStream > > > > {
825833 fn connected ( & self ) -> Connected {
826- self . inner
834+ let connected = self
835+ . inner
827836 . inner ( )
828837 . get_ref ( )
829838 . get_ref ( )
830839 . get_ref ( )
831840 . inner ( )
832- . connected ( )
841+ . connected ( ) ;
842+ #[ cfg( feature = "native-tls-alpn" ) ]
843+ match self . inner . inner ( ) . get_ref ( ) . negotiated_alpn ( ) . ok ( ) {
844+ Some ( Some ( alpn_protocol) ) if alpn_protocol == b"h2" => connected. negotiated_h2 ( ) ,
845+ _ => connected,
846+ }
847+ #[ cfg( not( feature = "native-tls-alpn" ) ) ]
848+ connected
833849 }
834850 }
835851
You can’t perform that action at this time.
0 commit comments