Ticket #6189: mythweb-0.21-content-range.patch

File mythweb-0.21-content-range.patch, 783 bytes (added by Tom Dexter <digitalaudiorock@…>, 11 years ago)
  • mythplugins/mythweb/modules/stream/handler.pl

     
    231231
    232232# Requested a range?
    233233    my $start      = 0;
    234     my $end        = $size;
     234    my $end        = $size - 1;
    235235    my $total_size = $size;
    236236    if ($ENV{'HTTP_RANGE'}) {
    237237    # Figure out the size of the requested chunk
    238238        ($start, $end) = $ENV{'HTTP_RANGE'} =~ /bytes\W+(\d*)-(\d*)\W*$/;
    239239        $start ||= 0;
    240         if ($end < 1 || $end > $size) {
    241             $end = $size;
     240        $end ||= 0;
     241        if ($end < 1 || $end >= $size) {
     242            $end = $size - 1;
    242243        }
    243         $size = $end - $start;
     244        $size = $end - $start + 1;
    244245    }
    245246
    246247# Print the header