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

Comparing AnyEvent-HTTP/README (file contents):
Revision 1.26 by root, Thu May 14 02:04:35 2015 UTC vs.
Revision 1.27 by root, Sun Aug 28 09:31:29 2016 UTC

500 or die "$file: $!"; 500 or die "$file: $!";
501 501
502 my %hdr; 502 my %hdr;
503 my $ofs = 0; 503 my $ofs = 0;
504 504
505 warn stat $fh;
506 warn -s _;
507 if (stat $fh and -s _) { 505 if (stat $fh and -s _) {
508 $ofs = -s _; 506 $ofs = -s _;
509 warn "-s is ", $ofs; 507 warn "-s is ", $ofs;
510 $hdr{"if-unmodified-since"} = AnyEvent::HTTP::format_date +(stat _)[9]; 508 $hdr{"if-unmodified-since"} = AnyEvent::HTTP::format_date +(stat _)[9];
511 $hdr{"range"} = "bytes=$ofs-"; 509 $hdr{"range"} = "bytes=$ofs-";
539 my (undef, $hdr) = @_; 537 my (undef, $hdr) = @_;
540 538
541 my $status = $hdr->{Status}; 539 my $status = $hdr->{Status};
542 540
543 if (my $time = AnyEvent::HTTP::parse_date $hdr->{"last-modified"}) { 541 if (my $time = AnyEvent::HTTP::parse_date $hdr->{"last-modified"}) {
544 utime $fh, $time, $time; 542 utime $time, $time, $fh;
545 } 543 }
546 544
547 if ($status == 200 || $status == 206 || $status == 416) { 545 if ($status == 200 || $status == 206 || $status == 416) {
548 # download ok || resume ok || file already fully downloaded 546 # download ok || resume ok || file already fully downloaded
549 $cb->(1, $hdr); 547 $cb->(1, $hdr);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines