Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Increases chunk size

AuthorDaveJarvis <email>
Date2023-11-08 23:47:58 GMT-0800
Commit33f3e060767e3220c73bd73fcdeb30d403060e5a
Parent076d5ed
www/downloads/counter.php
ignore_user_abort( true );
+ // Do not impose a time limit.
+ set_time_limit( 0 );
+
// Allow setting session variables (cookies).
if( session_id() === PHP_SESSION_NONE ) {
$aborted = false;
$bytes_sent = $seek_start;
- $chunk_size = 1024 * 8;
+ $chunk_size = 1024 * 16;
while( !feof( $fp ) && !$aborted ) {
- set_time_limit( 0 );
- print( fread( $fp, $chunk_size ) );
+ print( @fread( $fp, $chunk_size ) );
$bytes_sent += $chunk_size;
Delta5 lines added, 3 lines removed, 2-line increase