princepawn has asked for the wisdom of the Perl Monks concerning the following question:
what is the best way to fix this?
sub Apache::send_range { my ($r,$fh, $offset, $end) = @_; seek($fh,$offset,0); my $buf; my $bufsiz=4096; my $current_position = $offset; sub read_size { my $amount_to_go = ($end - $current_position); if ($amount_to_go <= $bufsiz) { $bufsiz; } else { $amount_to_go; } } while (read($fh,$buf,read_size)) { $current_position += read_size; $r->print($buf); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: mod_perl: variable $end will not stay shared (nested subroutines problem)
by tye (Sage) on Apr 18, 2001 at 03:01 UTC | |
|
Re: mod_perl: variable $end will not stay shared (nested subroutines problem)
by arturo (Vicar) on Apr 17, 2001 at 23:55 UTC | |
by princepawn (Parson) on Apr 18, 2001 at 00:04 UTC | |
by arturo (Vicar) on Apr 18, 2001 at 00:35 UTC | |
|
Re: mod_perl: variable $end will not stay shared (nested subroutines problem)
by sierrathedog04 (Hermit) on Apr 18, 2001 at 01:46 UTC |