ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-HTTP/HTTP.pm
(Generate patch)

Comparing AnyEvent-HTTP/HTTP.pm (file contents):
Revision 1.90 by root, Mon Jan 3 00:41:25 2011 UTC vs.
Revision 1.91 by root, Mon Jan 3 01:03:29 2011 UTC

784 } 784 }
785 }; 785 };
786 786
787 $ae_error = 597; # body phase 787 $ae_error = 597; # body phase
788 788
789 my $chunked = $hdr{"transfer-encoding"} =~ /\bchunked\b/i; # not quite correct...
790
789 my $len = $hdr{"content-length"}; 791 my $len = $chunked ? undef : $hdr{"content-length"};
790 792
791 # body handling, many different code paths 793 # body handling, many different code paths
792 # - no body expected 794 # - no body expected
793 # - want_body_handle 795 # - want_body_handle
794 # - te chunked 796 # - te chunked
809 $_[0]->on_error (undef); 811 $_[0]->on_error (undef);
810 $_[0]->on_read (undef); 812 $_[0]->on_read (undef);
811 813
812 $finish->(delete $state{handle}); 814 $finish->(delete $state{handle});
813 815
814 } elsif ($hdr{"transfer-encoding"} =~ /\bchunked\b/i) { 816 } elsif ($chunked) {
815 my $cl = 0; 817 my $cl = 0;
816 my $body = undef; 818 my $body = undef;
817 my $on_body = $arg{on_body} || sub { $body .= shift; 1 }; 819 my $on_body = $arg{on_body} || sub { $body .= shift; 1 };
818 820
819 $state{read_chunk} = sub { 821 $state{read_chunk} = sub {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines