… | |
… | |
962 | my $body = ""; |
962 | my $body = ""; |
963 | my $on_body = $arg{on_body} || sub { $body .= shift; 1 }; |
963 | my $on_body = $arg{on_body} || sub { $body .= shift; 1 }; |
964 | |
964 | |
965 | $state{read_chunk} = sub { |
965 | $state{read_chunk} = sub { |
966 | $_[1] =~ /^([0-9a-fA-F]+)/ |
966 | $_[1] =~ /^([0-9a-fA-F]+)/ |
967 | or $finish->(undef, $ae_error => "Garbled chunked transfer encoding"); |
967 | or return $finish->(undef, $ae_error => "Garbled chunked transfer encoding"); |
968 | |
968 | |
969 | my $len = hex $1; |
969 | my $len = hex $1; |
970 | |
970 | |
971 | if ($len) { |
971 | if ($len) { |
972 | $cl += $len; |
972 | $cl += $len; |