Skip to content

Protocol::HTTP2::Client on_done gives undef header/content when tried with multiple streams #5

Description

@ranjith-t

Hi,
When I use Protocol::HTTP2::Client with request sent with multiple parallel requests(streams), the on_done() cb is returning undef values for header, content for all streams exept the last one(for which it returns valid data.).
my code snippet:
$self->client->request(
%$req,
on_done => sub {
my ($header, $content) = @
;
$msg = "_make_next_client_request::on_done!!!!!!!!!!!!!!!!!!!!!!!!!!";
warn Dumper($msg);
warn Dumper($header);
warn Dumper($content);

Note that I send more than one(4) requests using above code and then wait for responses using below code:
while ( $self->{'resp_revcd'} == 0 ) {
$self->{_io}->can_read;
while ( sysread $self->_socket, my $data, 4096 ) {
$self->_client->feed($data);
my $msg = "Recvd Response!!!!!!!!!!!!!!!!!!!!!!!";
warn Dumper($msg);
warn Dumper($data);

I could see that for all streams created(using request()), the response frames are received nd on_done() is called. Also the streams is correctly getting closed.

ouput for all streams(except first):
$VAR1 = 'Stream 7 changed state from HALF_CLOSED to CLOSED';
$VAR1 = '_make_next_client_request::on_done!!!!!!!!!!!!!!!!!!!!!!!!!!';
$VAR1 = undef;
$VAR1 = undef;

output for first stream:
$VAR1 = 'Stream 1 changed state from HALF_CLOSED to CLOSED';
$VAR1 = '_make_next_client_request::on_done!!!!!!!!!!!!!!!!!!!!!!!!!!';
$VAR1 = [
':status',
'410',
'xxxxx-xxx',
'dddddddddddddddddddddddddddd'
];
$VAR1 = '{"rrrrrrrr":"aaaaaaaaaaaaaaaa","timestamp":111111111111111111111111}';

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions