Roxen.git / server / modules / filesystems / filesystem.pike

version» Context lines:

Roxen.git/server/modules/filesystems/filesystem.pike:1:   // This is a roxen module. Copyright © 1996 - 2004, Roxen IS.      // This is a virtual "file-system".   // It will be located somewhere in the name-space of the server.   // Also inherited by some of the other filesystems.      inherit "module";   inherit "socket";    - constant cvs_version= "$Id: filesystem.pike,v 1.152 2005/12/13 15:45:59 anders Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.153 2006/12/13 15:44:55 grubba Exp $";   constant thread_safe=1;      #include <module.h>   #include <roxen.h>   #include <stat.h>   #include <request_trace.h>         //<locale-token project="mod_filesystem">LOCALE</locale-token>   #define LOCALE(X,Y) _DEF_LOCALE("mod_filesystem",X,Y)
Roxen.git/server/modules/filesystems/filesystem.pike:151:    "<tt>.www_not_browsable</tt> or a <tt>.nodiraccess</tt> file "    "in it. Similarly it is possible to let a directory be "    "browsable, even if the file system is not, by putting a "    "<tt>.www_browsable</tt> file in it.\n"));       defvar("nobrowse", ({ ".www_not_browsable", ".nodiraccess" }),    LOCALE(23,"List prevention files"), TYPE_STRING_LIST|VAR_MORE,    LOCALE(24,"All directories containing any of these files will not be "    "browsable."));    +  defvar("no-parse", 0, LOCALE(0, "Raw files"), TYPE_FLAG|VAR_MORE, +  LOCALE(0, "If set files from this filesystem will be returned " +  "without any further processing. This disables eg RXML " +  "parsing of files."));       defvar("tilde", 0, LOCALE(25,"Show backup files"), TYPE_FLAG|VAR_MORE,    LOCALE(26,"If set, files ending with '~', '#' or '.bak' will "+    "be shown in directory listings"));       defvar("put", 0, LOCALE(27,"Handle the PUT method"), TYPE_FLAG,    LOCALE(28,"If set, it will be possible to upload files with the HTTP "    "method PUT, or through FTP."));       defvar("delete", 0, LOCALE(29,"Handle the DELETE method"), TYPE_FLAG,
Roxen.git/server/modules/filesystems/filesystem.pike:891:    return Roxen.http_status(403, "File exists, but access forbidden "    "by user");    }       // Add a cache callback.    id->misc->_cachecallbacks += ({ CacheCallback(f, size) });       id->realfile = norm_f;    TRACE_LEAVE("");    accesses++; -  TRACE_LEAVE("Normal return"); +     if( charset != "iso-8859-1" )    {    if( id->set_output_charset )    id->set_output_charset( charset, 2 );    id->misc->input_charset = charset;    } -  +  if (query("no-parse")) { +  TRACE_ENTER("Content-type mapping module", types_module); +  array(string) tmp = conf->type_from_filename(norm_f, 1); +  TRACE_LEAVE(tmp?sprintf("Returned type %s %s.", tmp[0], tmp[1]||"") +  : "Missing type."); +  TRACE_LEAVE("No parse return"); +  return Roxen.http_file_answer(o, tmp[0]) + ([ "encoding":tmp[1] ]); +  } +  TRACE_LEAVE("Normal return");    return o;    }    break;       case "MKCOL":    if (id->request_headers["content-type"] || sizeof (id->data)) {    // RFC 2518 8.3.1:    // If a server receives a MKCOL request entity type it does not support    // or understand it MUST respond with a 415 (Unsupported Media Type)    // status code.