Index: openacs-4/packages/acs-subsite/www/admin/host-node-map/add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/host-node-map/Attic/add.tcl,v diff -u -r1.1 -r1.1.4.1 --- openacs-4/packages/acs-subsite/www/admin/host-node-map/add.tcl 10 Oct 2001 18:15:13 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/host-node-map/add.tcl 8 Feb 2003 16:48:43 -0000 1.1.4.1 @@ -7,6 +7,9 @@ root:integer } +# Flush the cache +util_memoize_flush_regexp "rp_lookup_node_from_host" + db_dml host_node_insert { insert into host_node_map (host, node_id) Index: openacs-4/packages/acs-subsite/www/admin/host-node-map/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/host-node-map/delete.tcl,v diff -u -r1.1 -r1.1.4.1 --- openacs-4/packages/acs-subsite/www/admin/host-node-map/delete.tcl 10 Oct 2001 18:15:13 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/host-node-map/delete.tcl 8 Feb 2003 16:48:43 -0000 1.1.4.1 @@ -7,6 +7,9 @@ node_id:integer } +# Flush the cache +util_memoize_flush_regexp "rp_lookup_node_from_host" + db_dml host_node_delete { delete from host_node_map where host = :host Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl,v diff -u -r1.25.2.4 -r1.25.2.5 --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 16 Dec 2002 11:36:09 -0000 1.25.2.4 +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 8 Feb 2003 16:49:30 -0000 1.25.2.5 @@ -1225,20 +1225,18 @@ return "" } # Other hostnames map to subsites. - set found_node_id [db_0or1row node_id { - select node_id - from host_node_map - where host = :host - }] + set node_id [util_memoize [list rp_lookup_node_from_host $host]] - if { $found_node_id == 1 } { - db_1row root_get { - select site_node.url(:node_id) as url - from dual - } + if { ![empty_string_p $node_id] } { + set url [site_node::get_url -node_id $node_id] + return [string range $url 0 [expr [string length $url]-2]] } else { # Hack to provide a useful default return "" } } + +ad_proc -private rp_lookup_node_from_host { host } { + return [db_string node_id { *SQL* } -default ""] +} Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/request-processor-procs.xql,v diff -u -r1.2 -r1.2.4.1 --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.xql 10 Oct 2001 18:28:49 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.xql 8 Feb 2003 16:49:30 -0000 1.2.4.1 @@ -20,7 +20,7 @@ - + select node_id