… | |
… | |
494 | . (join "", map "\u$_: $hdr{$_}\015\012", grep defined $hdr{$_}, keys %hdr) |
494 | . (join "", map "\u$_: $hdr{$_}\015\012", grep defined $hdr{$_}, keys %hdr) |
495 | . "\015\012" |
495 | . "\015\012" |
496 | . (delete $arg{body}) |
496 | . (delete $arg{body}) |
497 | ); |
497 | ); |
498 | |
498 | |
|
|
499 | # return if error occured during push_write() |
|
|
500 | return unless %state; |
|
|
501 | |
499 | %hdr = (); # reduce memory usage, save a kitten |
502 | %hdr = (); # reduce memory usage, save a kitten |
500 | |
503 | |
501 | # status line |
504 | # status line |
502 | $state{handle}->push_read (line => $qr_nl, sub { |
505 | $state{handle}->push_read (line => $qr_nl, sub { |
503 | $_[1] =~ /^HTTP\/([0-9\.]+) \s+ ([0-9]{3}) (?: \s+ ([^\015\012]*) )?/ix |
506 | $_[1] =~ /^HTTP\/([0-9\.]+) \s+ ([0-9]{3}) (?: \s+ ([^\015\012]*) )?/ix |