This is an automated email from the ASF dual-hosted git repository. mxmanghi pushed a commit to branch quattuor in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit f0b871006786d1babeb98bc2aac1bdfd72fa6de0 Author: Massimo Manghi <mxman...@apache.org> AuthorDate: Wed Jun 14 17:21:25 2023 +0200 merging from master --- ChangeLog | 9 ++++++- rivet/init.tcl.in | 4 +-- rivet/packages/session/session-class.tcl | 9 +++---- rivet/rivet-tcl/parray.tcl | 14 +++++------ src/mod_rivet_ng/mod_rivet.c | 11 +++----- src/mod_rivet_ng/mod_rivet_generator.c | 2 -- tests/channel.test | 43 ++++++++++++++++---------------- 7 files changed, 45 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index 91f4d2f..b33ff6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-06-14 Massimo Manghi <mxman...@apache.org> + * tests/channel.test: indenting code for improved readability + * src/mod_rivet_ng/mod_rivet.c,mod_rivet_generator.c: Removed unused code that + ha been commented out long ago + * rivet/rivet-tcl/parray.tcl: ::rivet::parray now accepting alternative way to + return output. + 2023-05-18 Massimo Manghi <mxman...@apache.org> * src/mod_rivet_ng/mod_rivet.c: * src/mod_rivet_ng/mod_rivet.h: @@ -7,7 +14,7 @@ to be used by Rivet_LogErrorCmd instead of module_globals->server when threads private data are not available (like when ChildInitScript is executed) -2023-05-04 Massimo Manghi <mxman...@apache.org> +2023-05-14 Massimo Manghi <mxman...@apache.org> * tests/rivet.test: more contributions provided by Scott Pitcher <sco...@svptechnicalservices.com.au>) * tests/apachetest/apachetest.tcl: More improvements to the test script. Now handling also Apache directive IncludeOptional and enabling execution control diff --git a/rivet/init.tcl.in b/rivet/init.tcl.in index 9ab96b9..e260953 100644 --- a/rivet/init.tcl.in +++ b/rivet/init.tcl.in @@ -235,8 +235,8 @@ proc ::Rivet::tcl_commands_export_list {tclpath} { variable auto_index array set auto_index {} - # the auto_index in ${tclpath}/tclIndex is loaded - # this array is used to fetch a list of Rivet commands + # The auto_index in ${tclpath}/tclIndex is loaded. + # This array is used to fetch a list of Rivet commands # implemented in Rivet set dir $tclpath diff --git a/rivet/packages/session/session-class.tcl b/rivet/packages/session/session-class.tcl index 28fb3e1..1ce51f4 100644 --- a/rivet/packages/session/session-class.tcl +++ b/rivet/packages/session/session-class.tcl @@ -346,21 +346,18 @@ package require Itcl } # - # stash - + # stash - given a packagename and a key-value dictionary of data + # the procedure calls method store to data into the cache table using + # the dictionary keys as column _key value # # method stash {packageName keyvalue_d} { - dict for {key value} $keyvalue_d { - $this store $packageName $key $value - } - } - # # load - given a package names returns a dictionary storing the key - value pairs for this session # diff --git a/rivet/rivet-tcl/parray.tcl b/rivet/rivet-tcl/parray.tcl index 784b01e..b9f2582 100644 --- a/rivet/rivet-tcl/parray.tcl +++ b/rivet/rivet-tcl/parray.tcl @@ -7,13 +7,11 @@ ## arrayName - Name of the array to display. ## pattern - A wildcard pattern of variables within the array to display. ## -## $Id$ -## ### namespace eval ::rivet { - proc parray {arrayName {pattern *}} { + proc parray {arrayName {pattern *} {outputcmd "puts stdout"}} { upvar 1 $arrayName array if {![array exists array]} { return -code error "\"$arrayName\" isn't an array" @@ -24,14 +22,14 @@ namespace eval ::rivet { set maxl [string length $name] } } - puts stdout "<PRE><B>$arrayName</B>" + set html_text [list "<b>$arrayName</b>"] set maxl [expr {$maxl + [string length $arrayName] + 2}] foreach name [lsort [array names array $pattern]] { - set nameString [format %s(%s) $arrayName [::rivet::escape_sgml_chars $name]] - puts stdout [format "%-*s = %s" $maxl $nameString [::rivet::escape_sgml_chars $array($name)]] + set nameString [format "%s(%s)" $arrayName [::rivet::escape_sgml_chars $name]] + lappend html_text [format "%-*s = %s" $maxl $nameString [::rivet::escape_sgml_chars $array($name)]] } - puts stdout "</PRE>" + + eval $outputcmd [list <pre>[join $html_text "\n"]</pre>] } - namespace export parray } diff --git a/src/mod_rivet_ng/mod_rivet.c b/src/mod_rivet_ng/mod_rivet.c index c63efda..24c685b 100644 --- a/src/mod_rivet_ng/mod_rivet.c +++ b/src/mod_rivet_ng/mod_rivet.c @@ -389,6 +389,9 @@ Rivet_RunServerInit (apr_pool_t *pPool, apr_pool_t *pLog, apr_pool_t *pTemp, ser * Post config hook. The server initialization loads the MPM bridge * and runs the Tcl server initialization script * + * The module globals structure is allocated and initialized by + * the pre-config hook procedure (Rivet_InitGlobals) + * */ static int @@ -421,13 +424,7 @@ Rivet_ServerInit (apr_pool_t *pPool, apr_pool_t *pLog, apr_pool_t *pTemp, server return OK; /* This would be the first time through */ } - /* Everything revolves around this structure: module_globals */ - - /* the module global structure is allocated and the MPM bridge name established */ - - // module_globals = Rivet_CreateModuleGlobals (pPool,server); - - /* We can proceed initializing the globals with information stored in the module configuration */ + /* We determine the Rivet Bridge and we store its pointer in the module globals */ module_globals->rivet_mpm_bridge = Rivet_SeekMPMBridge(pPool); module_globals->server = server; diff --git a/src/mod_rivet_ng/mod_rivet_generator.c b/src/mod_rivet_ng/mod_rivet_generator.c index 7d81d7f..54c9861 100644 --- a/src/mod_rivet_ng/mod_rivet_generator.c +++ b/src/mod_rivet_ng/mod_rivet_generator.c @@ -359,8 +359,6 @@ sendcleanup: ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, private->r, "thread terminating with code %d",private->exit_status); RIVET_MPM_BRIDGE_CALL(exit_handler,private); - //Tcl_Exit(private->exit_status); - //exit(private->exit_status); } /* We now reset the status to prepare the child process for another request */ diff --git a/tests/channel.test b/tests/channel.test index e2f6454..0c2967b 100644 --- a/tests/channel.test +++ b/tests/channel.test @@ -2,27 +2,28 @@ foreach {sep_channel offset_value} {On 0 Off 1} { -::tcltest::test channel-1.1 [list checking SeparateChannel] { - apachetest::start {} " -RivetServerConf SeparateVirtualInterps On -RivetServerConf SeparateChannels $sep_channel -#NameVirtualHost 127.0.0.1 -<VirtualHost *> - ServerName vhost1 - RivetServerConf ChildInitScript \"fconfigure stdout -buffersize 8192\" -</VirtualHost> + ::tcltest::test channel-1.1 [list checking SeparateChannel] { + apachetest::start {} " + RivetServerConf SeparateVirtualInterps On + RivetServerConf SeparateChannels $sep_channel + #NameVirtualHost 127.0.0.1 + <VirtualHost *> + ServerName vhost1 + RivetServerConf ChildInitScript \"fconfigure stdout -buffersize 8192\" + </VirtualHost> -<VirtualHost *> - ServerName vhost2 - RivetServerConf ChildInitScript \"fconfigure stdout -buffersize 16384\" -</VirtualHost> -" { - set page1 [::http::geturl "${urlbase}channel.tcl" -headers [list Host vhost1]] - set page2 [::http::geturl "${urlbase}channel.tcl" -headers [list Host vhost2]] + <VirtualHost *> + ServerName vhost2 + RivetServerConf ChildInitScript \"fconfigure stdout -buffersize 16384\" + </VirtualHost> + " { + set page1 [::http::geturl "${urlbase}channel.tcl" -headers [list Host vhost1]] + set page2 [::http::geturl "${urlbase}channel.tcl" -headers [list Host vhost2]] + + puts "[::http::data $page1] [::http::data $page2]" + set diff [expr ([::http::data $page2]-[::http::data $page1] != 0) + $offset_value] + } + set diff + } {1} - puts "[::http::data $page1] [::http::data $page2]" - set diff [expr ([::http::data $page2]-[::http::data $page1] != 0) + $offset_value] -} -set diff -} {1} } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@tcl.apache.org For additional commands, e-mail: commits-h...@tcl.apache.org