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 - 2009, Roxen IS.   //      // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.702 2010/06/28 06:57:57 marty Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.703 2010/07/12 20:07:43 mast 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)      // Tell Pike.count_memory this is global.   constant pike_cycle_depth = 0;
Roxen.git/server/base_server/configuration.pike:4441: Inside #if ROXEN_COMPAT < 2.2
  {    if (sql_urls[db])    return sql_cache_get(sql_urls[db], 0, charset);    else    return sql_cache_get(db, 0, charset);   }      // END SQL   #endif    - protected string my_url; + protected string my_url, my_host;      void fix_my_url()   {    my_url = query ("MyWorldLocation");    if (!sizeof (my_url) &&    !(my_url = Roxen.get_world (query ("URLs"))))    // Probably no port configured. The empty string is used as a    // flag; there shouldn't be any bad fallback here.    my_url = "";    else    if (!has_suffix (my_url, "/")) my_url += "/"; -  +  +  if (sscanf (my_url, "%*s://[%s]", string hostv6) == 2 || +  sscanf (my_url, "%*s://%[^:/]", string hostv4) == 2) +  my_host = hostv6 ? "[" + hostv6 + "]" : hostv4; +  else +  my_host = 0;   }      //! Returns some URL for accessing the configuration. (Should be   //! used instead of querying MyWorldLocation directly.)   string get_url() {return my_url;}    -  + //! Returns the host part of the URL returned by @[get_url]. Returns + //! zero when @[get_url] cannot return any useful value (i.e. it + //! returns the empty string). + string get_host() {return my_host;} +    array after_init_hooks = ({});   mixed add_init_hook( mixed what )   {    if( inited )    call_out( what, 0, this_object() );    else    after_init_hooks |= ({ what });   }      protected int got_no_delayed_load = 0;