Index: openacs-4/packages/acs-api-browser/acs-api-browser.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/acs-api-browser.info,v diff -u -r1.40.2.5 -r1.40.2.6 --- openacs-4/packages/acs-api-browser/acs-api-browser.info 16 Sep 2021 08:27:08 -0000 1.40.2.5 +++ openacs-4/packages/acs-api-browser/acs-api-browser.info 29 Oct 2021 10:35:59 -0000 1.40.2.6 @@ -7,7 +7,7 @@ t t - + OpenACS Interactive documentation for the Tcl and SQL APIs. 2021-09-15 @@ -17,8 +17,8 @@ 3 On line interactive documentation for the locally installed Tcl and SQL APIs. Links to the Tcl core and NaviServer/AOLServer online documentation as well. - - + + Index: openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl,v diff -u -r1.72.2.34 -r1.72.2.35 --- openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 28 Oct 2021 10:10:28 -0000 1.72.2.34 +++ openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 29 Oct 2021 10:35:59 -0000 1.72.2.35 @@ -1199,11 +1199,7 @@ # if we have some indent, remove it from the lines. # if {[info exists indent]} { - set lines [lmap line $lines { - set x [regexp "^${indent}(.*)$" $line . line] - set line - }] - set body [join $lines \n] + set body [ns_trim -prefix $indent $body] } set doc [::xo::api get_doc_block $body body] } Index: openacs-4/packages/acs-tcl/acs-tcl.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/acs-tcl.info,v diff -u -r1.95.2.34 -r1.95.2.35 --- openacs-4/packages/acs-tcl/acs-tcl.info 4 Oct 2021 09:37:00 -0000 1.95.2.34 +++ openacs-4/packages/acs-tcl/acs-tcl.info 29 Oct 2021 10:35:59 -0000 1.95.2.35 @@ -9,7 +9,7 @@ f t - + OpenACS The Kernel Tcl API library. 2021-09-15 @@ -18,7 +18,7 @@ GPL version 2 3 - + Index: openacs-4/packages/acs-tcl/tcl/00-icanuse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/00-icanuse-procs.tcl,v diff -u -r1.1.2.29 -r1.1.2.30 --- openacs-4/packages/acs-tcl/tcl/00-icanuse-procs.tcl 28 Sep 2021 12:46:48 -0000 1.1.2.29 +++ openacs-4/packages/acs-tcl/tcl/00-icanuse-procs.tcl 29 Oct 2021 10:35:59 -0000 1.1.2.30 @@ -110,9 +110,15 @@ ::acs::register_icanuse "ns_setcookie -samesite" [acs::cmd_error_contains ns_setcookie -samesite] ::acs::register_icanuse "ns_urlencode -part oauth1" [acs::cmd_error_contains {ns_urlencode -part xxx} oauth1] ::acs::register_icanuse "ns_writer" {[info commands ::ns_writer] ne ""} -::acs::register_icanuse "nsv_dict" [acs::cmd_error_contains {nsv_dict get ""} -varname] # +# At the time "ns_trim -prefix was introduced, a memory leak in +# nsv_dict was removed that could lead to a growing size of NaviServer +# on busy sites. +# +::acs::register_icanuse "nsv_dict" [acs::cmd_error_contains {ns_trim} -prefix] + +# # The following commands check indirectly the availability, since the # commands require connections etc. These features were introduced # after the queried functionality was introduced. @@ -129,6 +135,8 @@ # emulated. # if {[namespace which ns_base64urlencode] eq ""} { + ns_log notice "... define compatibility version for ns_base64urlencode" + # # Compatibility for AOLserver or NaviServer before 4.99.17 # @@ -141,6 +149,8 @@ } if {[namespace which ::ns_dbquotelist] eq ""} { + ns_log notice "... define compatibility version for ns_dbquotelist" + ad_proc -public ns_dbquotelist { list {type text} @@ -164,14 +174,15 @@ return $sql } } +if {![acs::cmd_error_contains {ns_trim} -prefix]} { + ns_log notice "... define compatibility version for ns_trim" -if {[namespace which ::ns_trim] eq ""} { - ad_proc ns_trim { {-delimiter ""} + {-prefix ""} text } { - Delimiter line trim command + Delimiter line trim command. Strip from the begin of every line characters whitespace followed by the specified delimiter character. Example: @@ -181,21 +192,35 @@ | World! }] - This function could/should be coded in C for speed. + This function is part of NaviServer, the Tcl version is just a + fallback, when older versions of NaviServer are used. } { - if {$delimiter ne ""} { - set re "^\\s*\[$delimiter\](.*)$" + if {$prefix ne ""} { + set len [string length $prefix] + set lines [lmap line [split $text \n] { + if {[string range $line 0 $len-1] eq $prefix} { + set line [string range $line $len end] + } + set line + }] + set text [join $lines \n] } else { - set re "^\\s*(\S*.*)$" + if {$delimiter ne ""} { + set re "^\\s*\[$delimiter\](.*)$" + } else { + set re "^\\s*(\S*.*)$" + } + set text [join [lmap line [split $text \n] { + regexp $re $line . line + set line + }] \n] } - join [lmap line [split $text \n] { - regexp $re $line . line - set line - }] \n + return $text } } if {[namespace which ::ns_uuid] eq ""} { + ns_log notice "... define compatibility version for ns_uuid" ad_proc ns_uuid {} { @@ -214,6 +239,8 @@ } if {[namespace which ::ns_parsehostport] eq ""} { + ns_log notice "... define compatibility version for ns_parsehostport" + ad_proc ns_parsehostport {hostport} { Backward compatibility function for parsing host and port.