From: paulr Date: Sat, 30 Jul 2011 19:36:26 +0000 (+1000) Subject: fixed .htaccess to deal with +'s in the query string X-Git-Url: http://git.pjr.cc/?a=commitdiff_plain;h=136e5dafcbb81dc6e347a6936e715d8ac134c5a7;p=glcas.git fixed .htaccess to deal with +'s in the query string --- 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)) {