Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2001, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.866 2004/03/10 16:56:42 grubba Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.867 2004/05/03 16:07:30 grubba Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:2167:    {    if( (lower_case( replace( replace(o->name, "-"," ") - " " ,    "/", "-" ) ) == name) ||    (lower_case( replace( replace(o->query_name(), "-", " ") - " " ,    "/", "-" ) ) == name) )    return o;    }    return 0;   }    + static int last_hrtime = gethrtime(1)/100; + static int clock_sequence = random(0x0fffffff); + // Generate an uuid string. + string new_uuid_string() + { +  object rnd = Crypto.randomness.reasonably_random(); +  string mac_address = rnd->read(6)|"\0\0\0\0\0\1"; // Multicast bit. +  int now = gethrtime(1)/100; +  int seq = clock_sequence++; +  if (now != last_hrtime) { +  seq = 0; +  clock_sequence = 1; +  last_hrtime = now; +  } +  // 100's of ns between 1582-10-15 00:00:00.00 and 1970-01-01 00:00:00.00. + #if 0 +  now -= Calendar.parse("%Y-%M-%D %h:%m:%s.%f %z", +  "1582-10-15 00:00:00.00 GMT")->unix_time() * 10000000; + #else /* !0 */ +  now += 0x01b21dd213814000; + #endif /* 0 */ +  now &= 0x0fffffffffffffff; +  now |= 0x1000000000000000; // DCE version 1. +  clock_sequence &= 0x3fff; +  clock_sequence |= 0x8000; +  return sprintf("%08x-%04x-%04x-%04x-%s", +  now & 0xffffffff, +  (now >> 32) & 0xffff, +  (now >> 48) & 0xffff, +  clock_sequence, +  Crypto.string_to_hex(mac_address)); + } +    mapping(string:array(int)) error_log=([]);      // Write a string to the administration interface error log and to stderr.   void nwrite(string s, int|void perr, int|void errtype,    object|void mod, object|void conf)   {    int log_time = time(1);    string reference = (mod ? Roxen.get_modname(mod) : conf && conf->name) || "";    string log_index = sprintf("%d,%s,%s", errtype, reference, s);    if(!error_log[log_index])