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.35 -r1.36 --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 17 May 2003 10:04:18 -0000 1.35 +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 29 Jun 2003 23:32:23 -0000 1.36 @@ -474,10 +474,10 @@ if { ![empty_string_p $root] } { if { [regexp "^${root}(.*)$" $url match url] } { - if [regexp {^GET [^\?]*\?(.*) HTTP} [ns_conn request] match vars] { + if { [regexp {^GET [^\?]*\?(.*) HTTP} [ns_conn request] match vars] } { append url ?$vars } - if {[ad_secure_conn_p]} { + if { [ad_secure_conn_p] } { # it's a secure connection. ad_returnredirect https://[ad_host][ad_port]$url return "filter_return" @@ -533,17 +533,11 @@ rp_debug -ns_log_level debug -debug t "rp_filter: setting up request: [ns_conn method] [ns_conn url] [ns_conn query]" - global tcl_site_nodes - if [catch { - if [catch { array set node $tcl_site_nodes([ad_conn url]) }] { - array set node [site_node [ad_conn url]] - set tcl_site_nodes([ad_conn url]) [array get node] - } - } errmsg] { + if { [catch { array set node [site_node::get -url [ad_conn url]] } errmsg] } { # log and do nothing rp_debug "error within rp_filter [ns_conn method] [ns_conn url] [ns_conn query]. $errmsg" } else { - if {[string equal $node(url) "[ad_conn url]/"]} { + if { [string equal $node(url) "[ad_conn url]/"] } { ad_returnredirect $node(url) rp_debug "rp_filter: returnredirect $node(url)" rp_debug "rp_filter: return filter_return" @@ -568,7 +562,7 @@ # ##### - if ![rp_performance_mode] { + if { ![rp_performance_mode] } { # We wrap this in a catch, because we don't want an error here to # cause the request to fail. if { [catch { apm_load_any_changed_libraries } error] } { @@ -610,7 +604,8 @@ # Make sure the user is authorized to make this request. # ##### - if { ![empty_string_p [ad_conn object_id]]} { + + if { ![empty_string_p [ad_conn object_id]] } { ad_try { if {[string match "admin/*" [ad_conn extra_url]]} { permission::require_permission -object_id [ad_conn object_id] -privilege admin @@ -740,19 +735,19 @@ set startclicks [clock clicks] rp_debug "rp_handler: handling request: [ns_conn method] [ns_conn url]?[ns_conn query]" - if [set code [catch { - if [rp_performance_mode] { + if { [set code [catch { + if { [rp_performance_mode] } { global tcl_url2file tcl_url2path_info - if ![catch { + if { ![catch { set file $tcl_url2file([ad_conn url]) set path_info $tcl_url2path_info([ad_conn url]) - } errmsg] { + } errmsg] } { ad_conn -set file $file ad_conn -set path_info $path_info rp_serve_concrete_file $file return } - rp_debug "cache miss in rp_handler: $errmsg" + rp_debug -debug t "error in rp_handler: $errmsg" } set paths [list] @@ -819,7 +814,9 @@ # Now visit the candidates columnwise: from most specific to least foreach cand0 [lindex $candidates 0] cand1 [lindex $candidates 1] { foreach candidate [list $cand0 $cand1] { - if [empty_string_p $candidate] continue; + if { [empty_string_p $candidate] } { + continue + } set root [lindex $candidate 0]; # fewer instructions than util_unlist set path [lindex $candidate 1] set prefix [lindex $candidate 2] @@ -847,7 +844,7 @@ ad_call_proc_if_exists ds_add rp [list transformation [list notfound $root/$path notfound] $startclicks [clock clicks]] ns_returnnotfound - } errmsg]] { + } errmsg]] } { if {$code == 1} { if {![string equal [ns_conn query] ""]} { set q ? @@ -1050,9 +1047,20 @@ Returns a property about the connection. See the request - processor documentation for a list of allowable values. If -set - is passed then it sets a property. + processor documentation for an (almost complete) list of allowable values. +

+ + If -set is passed then it sets a property. + +

+ + If the property has not been set directly by OpenACS it will be passed on to aolservers ns_conn: http://www.aolserver.com/docs/devel/tcl/api/conn.html#ns_conn. If it is not a valid option for ns_conn either then it will throw an error. + +

+ + Added recursion_count to properly deal with internalredirects. + added recursion_count to properly deal with internalredirects. } { global ad_conn