Roxen.git
/
server
/
base_server
/
module.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/base_server/module.pike:1:
// This file is part of Roxen WebServer. // Copyright © 1996 - 2004, Roxen IS.
-
// $Id: module.pike,v 1.
232
2008/
10/
12
22
:
14
:
03
mast
Exp $
+
// $Id: module.pike,v 1.
233
2008/
12
/
11
15
:
32
:
28
jonasw
Exp $
#include <module_constants.h> #include <module.h> #include <request_trace.h> constant __pragma_save_parent__ = 1; // Tell Pike.count_memory this is global. constant pike_cycle_depth = 0;
Roxen.git/server/base_server/module.pike:269:
array(string) location_urls() //! Returns an array of all locations where the module is mounted. { string loc = query_location(); if (!loc) return ({}); if(!_my_configuration) error("Please do not call this function from create()!\n"); array(string) urls = copy_value(_my_configuration->query("URLs")); string hostname;
-
if (string world_url = _my_configuration->query ("MyWorldLocation"))
-
sscanf
(world_url
,
"%*s://%s%*[:/]",
hostname
)
;
+
if (string world_url = _my_configuration->query ("MyWorldLocation"))
{
+
Standards.URI
uri = Standards.URI
(world_url
);
+
hostname
= uri->host
;
+
}
if (!hostname) hostname = gethostname(); for (int i = 0; i < sizeof (urls); i++) { urls[i] = (urls[i]/"#")[0]; if (sizeof (urls[i]/"*") == 2) urls[i] = replace(urls[i], "*", hostname); } return map (urls, `+, loc[1..]); }
Roxen.git/server/base_server/module.pike:298:
return "({ " + (map(a, lambda(object o) { return sprintf("%O", o); })*", ") + " })"; }; string loc = query_location(); if(!loc) return 0; if(!_my_configuration) error("Please do not call this function from create()!\n"); string hostname; string world_url = _my_configuration->query("MyWorldLocation");
-
if(world_url)
-
sscanf
(world_url
,
"%*s://%s%*[:/]",
hostname
)
;
+
if
(world_url)
{
+
Standards.URI uri = Standards.URI
(world_url
);
+
hostname
= uri->host
;
+
}
if(!hostname) hostname = gethostname(); #ifdef LOCATION_URL_DEBUG werror(" Hostname: %O\n", hostname); #endif Standards.URI candidate_uri; array(string) urls = filter(_my_configuration->registered_urls, has_prefix, "http:") + filter(_my_configuration->registered_urls, has_prefix, "https:"); foreach(urls, string url)