@@ -398,16 +398,10 @@ where
398398 self . go_away . go_away_now ( frame) ;
399399 }
400400
401- #[ doc( hidden) ]
402- #[ cfg( feature = "unstable" ) ]
403- fn go_away_now_debug_data ( & mut self ) {
401+ fn go_away_now_data ( & mut self , e : Reason , data : Bytes ) {
404402 let last_processed_id = self . streams . last_processed_id ( ) ;
405-
406- let frame = frame:: GoAway :: new ( last_processed_id, Reason :: NO_ERROR )
407- . with_debug_data ( "something went wrong" ) ;
408-
409- self . streams . send_go_away ( last_processed_id) ;
410- self . go_away . go_away ( frame) ;
403+ let frame = frame:: GoAway :: with_debug_data ( last_processed_id, e, data) ;
404+ self . go_away . go_away_now ( frame) ;
411405 }
412406
413407 fn go_away_from_user ( & mut self , e : Reason ) {
@@ -430,7 +424,7 @@ where
430424 // error. This is handled by setting a GOAWAY frame followed by
431425 // terminating the connection.
432426 Err ( Error :: GoAway ( debug_data, reason, initiator) ) => {
433- let e = Error :: GoAway ( debug_data, reason, initiator) ;
427+ let e = Error :: GoAway ( debug_data. clone ( ) , reason, initiator) ;
434428 tracing:: debug!( error = ?e, "Connection::poll; connection error" ) ;
435429
436430 // We may have already sent a GOAWAY for this error,
@@ -447,7 +441,7 @@ where
447441
448442 // Reset all active streams
449443 self . streams . handle_error ( e) ;
450- self . go_away_now ( reason) ;
444+ self . go_away_now_data ( reason, debug_data ) ;
451445 Ok ( ( ) )
452446 }
453447 // Attempting to read a frame resulted in a stream level error.
@@ -588,17 +582,6 @@ where
588582 // for a pong before proceeding.
589583 self . inner . ping_pong . ping_shutdown ( ) ;
590584 }
591-
592- #[ doc( hidden) ]
593- #[ cfg( feature = "unstable" ) ]
594- pub fn go_away_debug_data ( & mut self ) {
595- if self . inner . go_away . is_going_away ( ) {
596- return ;
597- }
598-
599- self . inner . as_dyn ( ) . go_away_now_debug_data ( ) ;
600- self . inner . ping_pong . ping_shutdown ( ) ;
601- }
602585}
603586
604587impl < T , P , B > Drop for Connection < T , P , B >
0 commit comments