diff --git a/lib/Protocol/HTTP2/Frame/Goaway.pm b/lib/Protocol/HTTP2/Frame/Goaway.pm index 9d6e748..19b6d92 100644 --- a/lib/Protocol/HTTP2/Frame/Goaway.pm +++ b/lib/Protocol/HTTP2/Frame/Goaway.pm @@ -22,12 +22,18 @@ sub decode { . const_name( 'errors', $error_code ) . " last stream is $last_stream_id\n" ); - tracer->debug( "additional debug data: " - . bin2hex( substr( $$buf_ref, $buf_offset + 8 ) ) - . "\n" ) - if $length - 8 > 0; + my $goaway = { + error => $error_code, + last_stream_id => $last_stream_id + }; + + if ( $length > 8 ) { + my $data = substr( $$buf_ref, $buf_offset + 8 ); + $goaway->{data} = $data; + tracer->debug( "additional debug data: $data\n" ) + } - $con->goaway(1); + $con->goaway($goaway); return $length; }