Skip to content

Commit a079db1

Browse files
author
Nikolay Pelov
committed
Fixes vlet#11
On GOAWAY frame, store all the info as a hash in `$con->{goaway}`.
1 parent f87a93e commit a079db1

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lib/Protocol/HTTP2/Frame/Goaway.pm

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@ sub decode {
2222
. const_name( 'errors', $error_code )
2323
. " last stream is $last_stream_id\n" );
2424

25-
tracer->debug( "additional debug data: "
26-
. bin2hex( substr( $$buf_ref, $buf_offset + 8 ) )
27-
. "\n" )
28-
if $length - 8 > 0;
25+
my $goaway = {
26+
error => $error_code,
27+
last_stream_id => $last_stream_id
28+
};
29+
30+
if ( $length > 8 ) {
31+
my $data = substr( $$buf_ref, $buf_offset + 8 );
32+
$goaway->{data} = $data;
33+
tracer->debug( "additional debug data: $data\n" )
34+
}
2935

30-
$con->goaway(1);
36+
$con->goaway($goaway);
3137

3238
return $length;
3339
}

0 commit comments

Comments
 (0)