Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2001, Roxen IS.   //      // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.565 2004/05/03 20:24:26 grubba Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.566 2004/05/04 13:01:31 grubba Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>   #include <timers.h>      #define CATCH(P,X) do{mixed e;if(e=catch{X;})report_error("While "+P+"\n"+describe_backtrace(e));}while(0)      // --- Locale defines ---   //<locale-token project="roxen_start"> LOC_S </locale-token>
Roxen.git/server/base_server/configuration.pike:1375:    // Does not apply to this location module.    continue;    }    int(-2..1)|DAVLock lock_info =    function_object(func)->check_locks(subpath, recursive, id);    if (lock_info) return lock_info;    }    return 0;   }    - //! Unlock the lock identifier by @[locktoken] on @[path]. + //! Unlock the lock represented by @[lock] on @[path].   //!   //! @returns   //! Returns a result-mapping on error, and @expr{0@} (zero) on success. - mapping(string:mixed) unlock_file(string path, string locktoken, RequestID id) + mapping(string:mixed) unlock_file(string path, DAVLock lock, RequestID id)   {    // Canonicalize path.    if (!has_suffix(path, "/")) path+="/";       foreach(location_module_cache||location_modules(),    [string loc, function func])    {    if (has_prefix(path, loc)) {    // path == loc + subpath.    mapping(string:mixed) ret = -  function_object(func)->unlock_file(path[sizeof(loc)..], locktoken, id); +  function_object(func)->unlock_file(path[sizeof(loc)..], lock, id);       // FIXME: Semantics for partial unlocking?    if (ret) return ret; -  +  } else if (lock->recursive && has_prefix(loc, path)) { +  // loc == path + ignored. +  mapping(string:mixed) ret = +  function_object(func)->unlock_file("/", lock, id); +  +  // FIXME: Semantics for partial unlocking? +  if (ret) return ret;    }    } -  +  // destruct(lock);    return 0;   }      //! Attempt to lock @[path].   //!   //! @param path   //! Path to lock.   //!   //! @param locktype   //! Type of lock (currently only @expr{"DAV:write"@} is defined).
Roxen.git/server/base_server/configuration.pike:1460:    } else if (recursive && has_prefix(loc, path)) {    // loc == path + ignored.    subpath = "/";    } else {    // Does not apply to this location module.    continue;    }       mapping(string:mixed)|DAVLock new_lock =    function_object(func)->lock_file(subpath, lock, id); -  if (new_lock) { +     if (mappingp(new_lock)) {    // Failure. Unlock the new lock. -  unlock_file(path, locktoken, id); -  return new_lock; +  foreach(location_module_cache||location_modules(), +  [string loc2, function func2]) +  { +  if (has_prefix(path, loc2)) { +  // path == loc2 + subpath. +  mapping(string:mixed) ret = +  function_object(func2)->unlock_file(path[sizeof(loc2)..], +  lock, id); +  } else if (recursive && has_prefix(loc2, path)) { +  // loc2 == path + ignored. +  mapping(string:mixed) ret = +  function_object(func2)->unlock_file("/", lock, id);    } -  +  if (func == func2) break;    } -  +  // destruct(lock); +  return new_lock;    } -  +  }       // FIXME: Timeout handling?       // Success.    return lock;   }      mapping|int(-1..0) low_get_file(RequestID id, int|void no_magic)   //! The function that actually tries to find the data requested. All   //! modules except last and filter type modules are mapped, in order,