@@ -131,6 +131,9 @@ pub(super) enum User {
131131 feature = "ffi"
132132 ) ) ]
133133 BodyWriteAborted ,
134+ /// User tried to send a connect request with a nonzero body
135+ #[ cfg( all( feature = "client" , feature = "http2" ) ) ]
136+ InvalidConnectWithBody ,
134137 /// Error from future of user's Service.
135138 #[ cfg( any(
136139 all( any( feature = "client" , feature = "server" ) , feature = "http1" ) ,
@@ -395,6 +398,11 @@ impl Error {
395398 Error :: new_user ( User :: Body ) . with ( cause)
396399 }
397400
401+ #[ cfg( all( feature = "client" , feature = "http2" ) ) ]
402+ pub ( super ) fn new_user_invalid_connect ( ) -> Error {
403+ Error :: new_user ( User :: InvalidConnectWithBody )
404+ }
405+
398406 #[ cfg( all( any( feature = "client" , feature = "server" ) , feature = "http1" ) ) ]
399407 pub ( super ) fn new_shutdown ( cause : std:: io:: Error ) -> Error {
400408 Error :: new ( Kind :: Shutdown ) . with ( cause)
@@ -492,6 +500,10 @@ impl Error {
492500 feature = "ffi"
493501 ) ) ]
494502 Kind :: User ( User :: BodyWriteAborted ) => "user body write aborted" ,
503+ #[ cfg( all( feature = "client" , feature = "http2" ) ) ]
504+ Kind :: User ( User :: InvalidConnectWithBody ) => {
505+ "user sent CONNECT request with non-zero body"
506+ }
495507 #[ cfg( any(
496508 all( any( feature = "client" , feature = "server" ) , feature = "http1" ) ,
497509 all( feature = "server" , feature = "http2" )
0 commit comments