[Openupload-svn-update] SF.net SVN: openupload:[67] trunk
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2008-10-23 11:05:15
|
Revision: 67
http://openupload.svn.sourceforge.net/openupload/?rev=67&view=rev
Author: tsdogs
Date: 2008-10-23 11:02:34 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Add download timeout configuration option
Modified Paths:
--------------
trunk/CHANGELOG
trunk/TODO
trunk/lib/modules/default/files.inc.php
trunk/www/config.inc.php.example
Modified: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG 2008-10-23 10:42:46 UTC (rev 66)
+++ trunk/CHANGELOG 2008-10-23 11:02:34 UTC (rev 67)
@@ -1,5 +1,8 @@
Changelog before release (0.3?) (updated on 2008.10.18).
+* General
+ - make sub www folders not accessible by default (some index.html files)
+
* Registration
- Check for valid login name
- Enable registration with e-mail confirmation
@@ -32,6 +35,7 @@
* Download
- Changeed serve file method to not go over the memory php limit (output buffer)
+ - Make download timeout configurable.
* Web site
- Created index page
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-10-23 10:42:46 UTC (rev 66)
+++ trunk/TODO 2008-10-23 11:02:34 UTC (rev 67)
@@ -5,12 +5,6 @@
Translation
- Update the translations
-Download
-- Let it not reach timeout when serving a file.
-
-General
-- make sub www folders not accessible by default (some index.php/html files needed)
-
Templates
- remove absolute paths from templates, to retrieve default template file if template file is not found
Modified: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php 2008-10-23 10:42:46 UTC (rev 66)
+++ trunk/lib/modules/default/files.inc.php 2008-10-23 11:02:34 UTC (rev 67)
@@ -245,6 +245,12 @@
/* if we got this far the download should begin serving */
$file = app()->config['DATA_PATH'].'/'.$finfo['id'];
$filesize = filesize($file);
+ /* set to not timeout within default setting */
+ if (isset(app()->config['max_download_time'])) {
+ set_time_limit(app()->config['max_download_time']*60);
+ } else {
+ set_time_limit(7200); /* 2 hours should be enough */
+ }
/* disable and clean output buffer so it won't reach memory limit */
ob_end_clean();
header('Content-Type: '.$finfo['mime']);
Modified: trunk/www/config.inc.php.example
===================================================================
--- trunk/www/config.inc.php.example 2008-10-23 10:42:46 UTC (rev 66)
+++ trunk/www/config.inc.php.example 2008-10-23 11:02:34 UTC (rev 67)
@@ -51,6 +51,9 @@
/* Set maximum default upload size in MB*/
$CONFIG['max_upload_size']=100;
+/* Set the maximum time (in minutes) a download should take (putting it to 0 will disable the timeout, but it's not suggested) */
+$CONFIG['max_download_time']=120;
+
/* if registration is enabled confirm it by e-amil ? */
$CONFIG['registration']['email_confirm']='yes';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|