completed an install of centos.. yay
[glcas.git] / plugins / repo.php
index 5ec7a09..a908f03 100644 (file)
@@ -291,7 +291,6 @@ class GLCASRepo {
                        header("Content-Length: $fsize");
                        $sgotten = 0;
                        while(!feof($localfile)) {
-                               error_log("OTHERDOWNLOAD: get");
                                $data = fread($localfile, 2048);
                                if(!$data) {
                                        error_log("dollardata is pair shaped");
@@ -371,7 +370,8 @@ class GLCASRepo {
                        // the problem is here
                        error_log("Downloader: going ranged as other");
                        clearstatcache();
-                       $contentlen = file_get_contents($filename.".tmp.data.deleteme.size");
+                       if(file_exists($filename.".tmp.data.deleteme.size")) $contentlen = file_get_contents($filename.".tmp.data.deleteme.size");
+                       else $contentlen = filesize($filename);
                        $contenttype = mime_content_type($filename);
                        header("HTTP/1.1 206 Partial Content");
                        header("Content-Length: $rangelength");
@@ -384,10 +384,6 @@ class GLCASRepo {
                        
                        clearstatcache();
                                
-                       error_log("OTHERDOWNLOAD: im another downloader, please work for ranged");
-                               
-
-                       error_log("OTHERDOWNLOAD: im another downloader, please work");
                                
                        // first we wait until the file reaches $rangestart
                        while(filesize("$filename") < $rangestart) {
@@ -401,7 +397,7 @@ class GLCASRepo {
                        $sgotten = 0;
                        // need to think about this in pseudo code.
                        // 1. close the file and wait for it to get to $sgotten + 2048 or $fsize
-                       $cursize = filesize($filename.".tmp.data.deleteme");
+                       $cursize = filesize($filename);
                                
                                
                        $upload_finished = false;
@@ -467,7 +463,6 @@ class GLCASRepo {
                if(file_exists("$WEB_ROOT_FS/../bin/downloadfile.php")) {
                        $scall = "/usr/bin/php $WEB_ROOT_FS/../bin/downloadfile.php '$url' '$file' > /dev/null 2>&1 &";
                        system($scall);
-                       error_log("started as v, $v, $scall");
                } else {
                        error_log("cant find download helper... dieing");
                }