From 6106ad89147dec3e180931e3cee6c3973aac8150 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 18 Jan 2009 19:36:00 +0100 Subject: add http_sendfile() function - update fetch.php to use the new function darcs-hash:20090118183600-f07c6-65c818bba58fab8856c9f353ff4953ead9b5221e.gz --- inc/pageutils.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index ccf8d10b8..1fdb4f2d0 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -578,4 +578,22 @@ function http_conditionalRequest($timestamp){ exit; } +function http_sendfile($file) { + global $conf; + + //use x-sendfile header to pass the delivery to compatible webservers + if($conf['xsendfile'] == 1){ + header("X-LIGHTTPD-send-file: $file"); + return true; + }elseif($conf['xsendfile'] == 2){ + header("X-Sendfile: $file"); + return true; + }elseif($conf['xsendfile'] == 3){ + header("X-Accel-Redirect: $file"); + return true; + } + + return false; +} + //Setup VIM: ex: et ts=2 enc=utf-8 : -- cgit v1.2.3