- From: Xavier Beaudouin <kiwi AT cvs.caudiumforge.net>
- To: caudium-commits AT caudium.net
- Subject: CVS: caudium/server/modules/vhs vhs_dirparser.pike,1.14,1.15
- Date: Fri, 17 Dec 2004 16:11:34 +0100
Update of /cvs/caudium/caudium/server/modules/vhs
In directory cvs.caudiumforge.net:/tmp/cvs-serv32242/server/modules/vhs
Modified Files:
vhs_dirparser.pike
Log Message:
Same as in 1.4 (with same restrictions...)
Index: vhs_dirparser.pike
===================================================================
RCS file: /cvs/caudium/caudium/server/modules/vhs/vhs_dirparser.pike,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- vhs_dirparser.pike 12 Nov 2004 10:06:26 -0000 1.14
+++ vhs_dirparser.pike 17 Dec 2004 15:11:31 -0000 1.15
@@ -27,7 +27,7 @@
*
*/
-constant cvs_version = "$Id: vhs_dirparser.pike,v 1.14 2004/11/12 10:06:26
kiwi Exp $";
+constant cvs_version = "$Id: vhs_dirparser.pike,v 1.15 2004/12/17 15:11:31
kiwi Exp $";
int thread_safe = 1; /* Probably. Check _root */
#include <module.h>
@@ -197,6 +197,12 @@
"If one of these files is present in a directory, it will "
"be returned instead of the directory listing.");
+ defvar("indexredirectfiles", ({ }), "Index files with redirect",
TYPE_STRING_LIST,
+ "If one of these files is present in a directory, it will
redirected to it "
+ "instead of the directory listing. This is usefull when you get a
L7 load "
+ "balancer and you would like to handle this kind of file on a third
party "
+ "server.");
+
defvar("dotfiles", 0, "Show dotfiles", TYPE_FLAG|VAR_MORE,
"If set, show dotfiles (files beginning with '.') in directory"
" listings");
@@ -473,7 +479,7 @@
old_file = id->not_query;
if (old_file[-1] == '.') old_file = old_file[..strlen(old_file)-2];
- foreach (query("indexfiles") - ({""}), file) // Make recursion impossible
+ foreach (QUERY(indexfiles) - ({""}), file) // Make recursion impossible
{
DW(sprintf("old_file = %s, file = %s", old_file, file));
@@ -481,6 +487,25 @@
if (got = id->conf->low_get_file(id)) return got;
}
+
+ if(sizeof(QUERY(indexredirectfiles)))
+ {
+ foreach(QUERY(indexredirectfiles) - ({""}), file)
+ {
+ DW(sprintf("(redirect) old_file = %s, file = %s", old_file, file));
+
+ id->not_query = old_file + file;
+
+ if (got = id->conf->low_get_file(id))
+ {
+ if(id->query && sizeof(id->query))
+ return Caudium.HTTP.redirect(id->not_query + "?"+ id->query, id);
+ else
+ return Caudium.HTTP.redirect(id->not_query, id);
+ }
+ }
+ }
+
id->not_query = old_file;
- CVS: caudium/server/modules/vhs vhs_dirparser.pike,1.14,1.15, Xavier Beaudouin
Archive powered by MhonArc 2.6.10.