Roxen.git
/
server
/
etc
/
modules
/
Roxen.pmod
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/etc/modules/Roxen.pmod:6413:
if(sizeof(rows) < 2) return default_value; array values = (rows[1]/" ") - ({ "" }); if(sizeof(values) < 3) return default_value; return ([ "virtual": (int)values[1]/divisor, "resident": (int)values[2]/divisor ]); }
+
protected mapping(string:int) caches_initialized = ([]);
+
+
protected void init_cache_prefs(string cache_name)
+
{
+
if (caches_initialized[cache_name]) return;
+
+
// NB: We invalidate entries after successful lookup,
+
// if they don't seem to be valid anymore.
+
function cache_register =
+
all_constants()["cache"]["cache_register"];
+
object extend_entries_cache_prefs =
+
all_constants()["cache"]["extend_entries_cache_prefs"];
+
cache_register(cache_name, UNDEFINED, extend_entries_cache_prefs);
+
caches_initialized[cache_name] = 1;
+
}
+
string lookup_real_path_case_insens (string path, void|int no_warn, void|string charset) //! Looks up the given path case insensitively to a path in the real //! file system. I.e. all segments in @[path] that exist in the file //! system when matched case insensitively are converted to the same //! case they have when listed by @[get_dir]. Segments that don't //! exist are kept as-is. //! //! If a segment ambiguously matches several entries in a directory //! then it and all remaining segments are returned as-is. A warning
Roxen.git/server/etc/modules/Roxen.pmod:6475:
break; default: Charset.Encoder enc = Charset.encoder (charset); Charset.Decoder dec = Charset.decoder (charset); encode = lambda (string in) {return enc->feed (in)->drain();}; decode = lambda (string in) {return dec->feed (in)->drain();}; cache_name += ":" + enc->charset; break; }
+
init_cache_prefs(cache_name);
+
string dec_path, enc_path; int nonexist; void recur (string path) { string lc_path = lower_case (path); dec_path = cache_lookup (cache_name, lc_path); if (dec_path) { check_cached: {