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.147 2004/06/30 16:58:59 mast Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.148 2005/07/19 12:17:04 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:742:    chmod(norm_f, 0777 & ~(id->misc->umask || 022));    TRACE_LEAVE(sprintf("%s: Success", id->method));    TRACE_LEAVE(sprintf("%s: Success", id->method));    return Roxen.http_status(201, "Created");    }       TRACE_LEAVE(sprintf("%s: Failed", id->method));    return errno_to_status (err_code, 1, id);   }    + class CacheCallback(string f, int orig_size) + { +  int(0..1) `()(RequestId id, mixed key) +  { +  return _file_size(f, id) == orig_size; +  } + } +    mixed find_file( string f, RequestID id )   {    TRACE_ENTER("find_file(\""+f+"\")", 0);    object o;    int size;    string tmp;    string oldf = f;    object privs;    int code;   
Roxen.git/server/modules/filesystems/filesystem.pike:861:    {    errors++;    report_error(LOCALE(45,"Open of %s failed. Permission denied.\n"),f);       TRACE_LEAVE("");    TRACE_LEAVE("Permission denied.");    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;    }