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

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

     
    5757
    5858# Requested a range?
    5959    my $start      = 0;
    60     my $end        = $size;
     60    my $end        = $size - 1;
    6161    my $total_size = $size;
    6262    if ($ENV{'HTTP_RANGE'}) {
    6363    # Figure out the size of the requested chunk
    6464        ($start, $end) = $ENV{'HTTP_RANGE'} =~ /bytes\W+(\d*)-(\d*)\W*$/;
    6565        $start ||= 0;
    66         if ($end < 1 || $end > $size) {
    67             $end = $size;
     66        $end ||= 0;
     67        if ($end < 1 || $end >= $size) {
     68            $end = $size - 1;
    6869        }
    69         $size = $end - $start;
     70        $size = $end - $start + 1;
    7071    }
    7172
    7273# Print the header