From 136e5dafcbb81dc6e347a6936e715d8ac134c5a7 Mon Sep 17 00:00:00 2001 From: paulr Date: Sun, 31 Jul 2011 05:36:26 +1000 Subject: [PATCH] fixed .htaccess to deal with +'s in the query string --- plugins/repo.php | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/repo.php b/plugins/repo.php index a908f03..48ffae0 100644 --- a/plugins/repo.php +++ b/plugins/repo.php @@ -217,7 +217,7 @@ class GLCASRepo { // iterate over its length, send 8k at a time while(!feof($localfile)) { // read and send data - $data = fread($localfile, 8192); + $data = fread($localfile, 32768); echo $data; // flush so the client sees the data @@ -233,7 +233,8 @@ class GLCASRepo { // TODO: this is the function im working on // the alternative to this function is that if a file is in the process of being // downloaded, we simply serve from upstream... not a good idea tho unless we create - // a local proxy right here + // a local proxy right here - this function is a race condition waiting to be had + // lets hope its a good one! function downloadAndServe($filename, $repoid, $remoteurl) { @@ -287,7 +288,8 @@ class GLCASRepo { // this is where the fun starts - but this one isnt too bad. error_log("OTHERDOWNLOAD: im another downloader, please work"); - $fsize = file_get_contents("$filename.size"); + if(file_exists("$filename.size")) $fsize = file_get_contents("$filename.size"); + else $fsize = filesize($filename); header("Content-Length: $fsize"); $sgotten = 0; while(!feof($localfile)) { -- 1.7.0.4