- From: Xavier Beaudouin <kiwi AT cvs.caudiumforge.net>
- To: caudium-commits AT caudium.net
- Subject: CVS: caudium/server/modules/vhs vhs_dirparser.pike,1.13.2.1,1.13.2.2
- Date: Fri, 17 Dec 2004 16:08:14 +0100
Update of /cvs/caudium/caudium/server/modules/vhs
In directory cvs.caudiumforge.net:/tmp/cvs-serv32103/server/modules/vhs
Modified Files:
Tag: stable_1_4
vhs_dirparser.pike
Log Message:
Same as in 1.2 (but tested only on 1.2 since 1.4 is not usable).
Index: vhs_dirparser.pike
===================================================================
RCS file: /cvs/caudium/caudium/server/modules/vhs/vhs_dirparser.pike,v
retrieving revision 1.13.2.1
retrieving revision 1.13.2.2
diff -u -r1.13.2.1 -r1.13.2.2
--- vhs_dirparser.pike 12 Nov 2004 10:04:28 -0000 1.13.2.1
+++ vhs_dirparser.pike 17 Dec 2004 15:08:11 -0000 1.13.2.2
@@ -27,7 +27,7 @@
*
*/
-constant cvs_version = "$Id: vhs_dirparser.pike,v 1.13.2.1 2004/11/12
10:04:28 kiwi Exp $";
+constant cvs_version = "$Id: vhs_dirparser.pike,v 1.13.2.2 2004/12/17
15:08:11 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 http_redirect(id->not_query + "?"+ id->query, id);
+ else
+ return http_redirect(id->not_query, id);
+ }
+ }
+ }
+
id->not_query = old_file;
- CVS: caudium/server/modules/vhs vhs_dirparser.pike,1.13.2.1,1.13.2.2, Xavier Beaudouin
Archive powered by MhonArc 2.6.10.