Index: openacs-4/packages/chat/tcl/chat-ajax-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/tcl/chat-ajax-procs.tcl,v diff -u -r1.23.2.12 -r1.23.2.13 --- openacs-4/packages/chat/tcl/chat-ajax-procs.tcl 8 Apr 2020 12:02:18 -0000 1.23.2.12 +++ openacs-4/packages/chat/tcl/chat-ajax-procs.tcl 3 Oct 2021 17:38:48 -0000 1.23.2.13 @@ -72,7 +72,7 @@ select room_id, to_char(max(creation_date),'HH24:MI:SS YYYY-MM-DD') as last_activity from chat_msgs group by room_id } { - ::xo::clusterwide nsv_set [self]-$room_id-seen last [clock scan $last_activity] + ::acs::clusterwide nsv_set [self]-$room_id-seen last [clock scan $last_activity] } } Index: openacs-4/packages/xooauth/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xooauth/tcl/package-procs.tcl,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/xooauth/tcl/package-procs.tcl 10 Nov 2020 08:44:57 -0000 1.1.2.2 +++ openacs-4/packages/xooauth/tcl/package-procs.tcl 3 Oct 2021 17:38:49 -0000 1.1.2.3 @@ -73,7 +73,7 @@ } } set p [::xo::oauth::Package initialize -url "/oauth"] - ::xo::clusterwide ns_cache flush xotcl_object_type_cache root_folder-[$p id] + ::acs::clusterwide ns_cache flush xotcl_object_type_cache root_folder-[$p id] ::content::folder::delete -folder_id [$p folder_id] } Fisheye: Tag 1.5.2.2 refers to a dead (removed) revision in file `openacs-4/packages/xotcl-core/tcl/cluster-init.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/xotcl-core/tcl/cluster-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/cluster-procs.tcl,v diff -u -r1.13.2.1 -r1.13.2.2 --- openacs-4/packages/xotcl-core/tcl/cluster-procs.tcl 26 Aug 2020 18:50:43 -0000 1.13.2.1 +++ openacs-4/packages/xotcl-core/tcl/cluster-procs.tcl 3 Oct 2021 17:38:49 -0000 1.13.2.2 @@ -1,5 +1,5 @@ ::xo::library doc { - XOTcl cluster support + XOTcl cluster support (deprecated code, moved into ::acs::* namespace) @author Gustaf Neumann @creation-date 2007-07-19 @@ -8,135 +8,27 @@ namespace eval ::xo { - proc clusterwide args { - # first, execute the command on the local server - eval $args - # then, distribute the command in the cluster - ::xo::Cluster broadcast {*}$args + ad_proc -deprecated clusterwide args { + Execute a command on every machine in a cluster. + The command was moved into the ::acs::* namespace. + } { + ::acs::clusterwide {*}$args } - proc cache_flush_all {cache pattern} { - # Provide means to perform a wildcard-based cache flushing on - # (cluster) machines. - foreach n [ns_cache names $cache $pattern] {ns_cache flush $cache $n} + ad_proc -deprecated cache_flush_all {cache pattern} { + Provide means to perform a wildcard-based cache flushing on + (cluster) machines. } - - Class create Cluster -parameter {host {port 80}} - Cluster set allowed_host_patterns [list] - Cluster set url /xotcl-cluster-do - Cluster array set allowed_host { - "127.0.0.1" 1 + ::acs::cache_flush_all $cache $pattern } - # - # The allowed commands are of the form - # - command names followed by - # - optional "except patterns" - # - Cluster array set allowed_command { - set "" - unset "" - nsv_set "" - nsv_unset "" - nsv_incr "" - bgdelivery "" - ns_cache "^ns_cache\s+eval" - ns_cache_flush "" - xo::cache_flush_all "" - } - # - # Prevent unwanted object generations for unknown - # arguments of ::xo::Cluster. - # - Cluster proc unknown args { - error "[self] received unknown method $args" - } - # - # handling the ns_filter methods - # - Cluster proc trace args { - :log "" - return filter_return - } - Cluster proc preauth args { - :log "" - :incoming_request - return filter_return - } - Cluster proc postauth args { - :log "" - return filter_return - } - # - # handle incoming request issues - # - Cluster proc incoming_request {} { - set cmd [ns_queryget cmd] - set addr [lindex [ns_set iget [ns_conn headers] x-forwarded-for] end] - if {$addr eq ""} {set addr [ns_conn peeraddr]} - #ns_log notice "--cluster got cmd='$cmd' from $addr" - ad_try { - set result [::xo::Cluster execute [ns_conn peeraddr] $cmd] - } on error {errorMsg} { - ns_log notice "--cluster error: $errorMsg" - ns_return 417 text/plain $errorMsg - } on ok {r} { - #ns_log notice "--cluster success $result" - ns_return 200 text/plain $result - } - } - Cluster proc execute {host cmd} { - if {![info exists :allowed_host($host)]} { - set ok 0 - foreach g ${:allowed_host_patterns} { - if {[string match $g $host]} { - set ok 1 - break - } - } - if {!$ok} { - error "refuse to execute commands from $host (command: '$cmd')" - } - } - set cmd_name [lindex $cmd 0] - set key allowed_command($cmd_name) - #ns_log notice "--cluster $key exists ? [info exists :$key]" - if {[info exists :$key]} { - set except_RE [set :$key] - #ns_log notice "--cluster [list regexp $except_RE $cmd] -> [regexp $except_RE $cmd]" - if {$except_RE eq "" || ![regexp $except_RE $cmd]} { - ns_log notice "--cluster executes command '$cmd' from host $host" - return [eval $cmd] - } - } - error "command '$cmd' from host $host not allowed" + ad_proc -deprecated Cluster args { + Create a cluster node. The command was moved into the ::acs::* + namespace. + } { + ::acs::Cluster {*}$args } - # - # handline outgoing request issues - # - Cluster proc broadcast args { - foreach server [:info instances] { - $server message {*}$args - } - } - Cluster instproc message args { - :log "--cluster outgoing request to [:host]:[:port] // $args" - # set r [::xo::HttpRequest new -volatile \ - # -host [:host] -port [:port] \ - # -path [Cluster set url]?cmd=[ns_urlencode $args]] - # return [$r set data] - - set r [::xo::AsyncHttpRequest new -volatile \ - -host [:host] -port [:port] \ - -path [Cluster set url]?cmd=[ns_urlencode $args]] - - # ::bgdelivery do ::xo::AsyncHttpRequest new \ - # -host [:host] -port [:port] \ - # -path [Cluster set url]?cmd=[ns_urlencode $args] \ - # -mixin ::xo::AsyncHttpRequest::SimpleListener \ - # -proc finalize {obj status value} { :destroy } - - } + } ::xo::library source_dependent Index: openacs-4/packages/xowiki/tcl/chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/chat-procs.tcl,v diff -u -r1.54.2.20 -r1.54.2.21 --- openacs-4/packages/xowiki/tcl/chat-procs.tcl 28 Sep 2020 21:04:04 -0000 1.54.2.20 +++ openacs-4/packages/xowiki/tcl/chat-procs.tcl 3 Oct 2021 17:38:49 -0000 1.54.2.21 @@ -51,15 +51,15 @@ if {![nsv_exists $cls initialized]} { :log "-- initialize $cls" $cls initialize_nsvs - ::xo::clusterwide nsv_set $cls initialized \ + ::acs::clusterwide nsv_set $cls initialized \ [ad_schedule_proc \ -thread "t" [:sweepinterval] $cls sweep_all_chats] } if {![nsv_exists ${:array}-seen newest]} { - ::xo::clusterwide nsv_set ${:array}-seen newest 0 + ::acs::clusterwide nsv_set ${:array}-seen newest 0 } if {![nsv_exists ${:array}-color idx]} { - ::xo::clusterwide nsv_set ${:array}-color idx 0 + ::acs::clusterwide nsv_set ${:array}-color idx 0 } if {${:user_id} != 0 || [:session_id] != 0} { :init_user_color @@ -69,7 +69,7 @@ Chat instproc set_options {} { dict for {key value} ${:conf} { - ::xo::clusterwide nsv_set ${:array}-options $key $value + ::acs::clusterwide nsv_set ${:array}-options $key $value } foreach {key value} [nsv_array get ${:array}-options] { set :$key $value @@ -79,12 +79,12 @@ Chat instproc register_nsvs {msg_id user_id msg color secs} { # Tell the system we are back again, in case we were auto logged out if { ![nsv_exists ${:array}-login $user_id] } { - ::xo::clusterwide nsv_set ${:array}-login $user_id [clock seconds] + ::acs::clusterwide nsv_set ${:array}-login $user_id [clock seconds] } - ::xo::clusterwide nsv_set ${:array} $msg_id [list ${:now} $secs $user_id $msg $color] - ::xo::clusterwide nsv_set ${:array}-seen newest ${:now} - ::xo::clusterwide nsv_set ${:array}-seen last $secs - ::xo::clusterwide nsv_set ${:array}-last-activity $user_id ${:now} + ::acs::clusterwide nsv_set ${:array} $msg_id [list ${:now} $secs $user_id $msg $color] + ::acs::clusterwide nsv_set ${:array}-seen newest ${:now} + ::acs::clusterwide nsv_set ${:array}-seen last $secs + ::acs::clusterwide nsv_set ${:array}-last-activity $user_id ${:now} } Chat instproc add_msg {{-get_new:boolean true} {-uid ""} msg} { @@ -129,7 +129,7 @@ Chat instproc check_age {key ago} { if {$ago > ${:timewindow}} { - ::xo::clusterwide nsv_unset ${:array} $key + ::acs::clusterwide nsv_unset ${:array} $key #:log "--c unsetting $key" return 0 } @@ -171,7 +171,7 @@ :check_age $key [expr {(${:now} - $timestamp) / 1000}] } } - ::xo::clusterwide nsv_set ${:array}-seen ${:session_id} ${:now} + ::acs::clusterwide nsv_set ${:array}-seen ${:session_id} ${:now} # :log "--chat setting session_id ${:session_id}: ${:now}" } else { # :log "--chat nothing new for ${:session_id}" @@ -187,7 +187,7 @@ } } #:log "--chat setting session_id ${:session_id}: ${:now}" - ::xo::clusterwide nsv_set ${:array}-seen ${:session_id} ${:now} + ::acs::clusterwide nsv_set ${:array}-seen ${:session_id} ${:now} :render } @@ -217,13 +217,13 @@ # These values could already not be here. Just ignore when we don't # find them try { - ::xo::clusterwide nsv_unset -nocomplain ${:array}-login $user_id + ::acs::clusterwide nsv_unset -nocomplain ${:array}-login $user_id } try { - ::xo::clusterwide nsv_unset -nocomplain ${:array}-color $user_id + ::acs::clusterwide nsv_unset -nocomplain ${:array}-color $user_id } try { - ::xo::clusterwide nsv_unset -nocomplain ${:array}-last-activity $user_id + ::acs::clusterwide nsv_unset -nocomplain ${:array}-last-activity $user_id } } @@ -234,8 +234,8 @@ set colors [::xo::parameter get -parameter UserColors -default [[:info class] set colors]] # ns_log notice "getting colors of [:info class] = [info exists colors]" set color [lindex $colors [expr { [nsv_get ${:array}-color idx] % [llength $colors] }]] - ::xo::clusterwide nsv_set ${:array}-color ${:user_id} $color - ::xo::clusterwide nsv_incr ${:array}-color idx + ::acs::clusterwide nsv_set ${:array}-color ${:user_id} $color + ::acs::clusterwide nsv_incr ${:array}-color idx } } @@ -256,8 +256,8 @@ } elseif {${:user_id} > 0 && ![nsv_exists ${:array}-login ${:user_id}]} { # give some proof of our presence to the chat system when we # don't issue the login message - ::xo::clusterwide nsv_set ${:array}-login ${:user_id} [clock seconds] - ::xo::clusterwide nsv_set ${:array}-last-activity ${:user_id} ${:now} + ::acs::clusterwide nsv_set ${:array}-login ${:user_id} [clock seconds] + ::acs::clusterwide nsv_set ${:array}-last-activity ${:user_id} ${:now} } :encoder noencode #:log "--chat setting session_id ${:session_id}: ${:now} mode=${:mode}" @@ -384,9 +384,9 @@ ChatClass method flush_messages {-chat_id:required} { set array "[self]-$chat_id" - ::xo::clusterwide nsv_unset -nocomplain $array - ::xo::clusterwide nsv_unset -nocomplain $array-seen - ::xo::clusterwide nsv_unset -nocomplain $array-last-activity + ::acs::clusterwide nsv_unset -nocomplain $array + ::acs::clusterwide nsv_unset -nocomplain $array-seen + ::acs::clusterwide nsv_unset -nocomplain $array-last-activity } ChatClass method init {} { Index: openacs-4/packages/xowiki/tcl/link-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/link-procs.tcl,v diff -u -r1.106.2.17 -r1.106.2.18 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 2 Sep 2021 13:24:28 -0000 1.106.2.17 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 3 Oct 2021 17:38:49 -0000 1.106.2.18 @@ -633,12 +633,12 @@ # Class create LinkCache # LinkCache proc flush {parent_id {item_id ""}} { # if {$item_id eq ""} { - # :xo::clusterwide xo::cache_flush_all xowiki_cache link-*-$name-$parent_id + # :acs::clusterwide acs::cache_flush_all xowiki_cache link-*-$name-$parent_id # } else { # foreach entry [ns_cache names xowiki_cache link-*-$parent_id] { # array set tmp [ns_cache get xowiki_cache $entry] # if {$tmp(item_id) == $item_id} { - # ::xo::clusterwide ns_cache flush xowiki_cache $entry + # ::acs::clusterwide ns_cache flush xowiki_cache $entry # } # } # }