This is an automated email from the ASF dual-hosted git repository. mxmanghi pushed a commit to branch 3.1 in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit e3af6c464618714fd4f03f250694f814166fcb47 Author: Massimo Manghi <mxman...@apache.org> AuthorDate: Fri Nov 23 19:09:24 2018 +0100 Applying patch to fix bug #62926, preparing to release 3.1.0 --- ChangeLog | 18 ++++++++++++++++++ VERSION | 2 +- configure.ac | 2 +- doc/rivet.xml | 25 +++++++++++++------------ doc/rivet.xml.in | 23 ++++++++++++----------- rivet/init.tcl | 4 ++-- src/mod_rivet_ng/rivetCore.c | 23 ++++++++++++++++++++++- tests/fqrivet_var.tcl | 40 ++++++++++++++++++++++++++++++++++++++++ tests/post.test | 23 +++++++++++++++++++++++ 9 files changed, 132 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b8daee..8bd06ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2018-11-23 Massimo Manghi <mxman...@apache.org> + * : code branched as branch 3.1 + * configure.ac,VERSION: bumping to version 3.0.4 + +2018-11-20 Massimo Manghi <mxman...@apache.org> + * src/mod_rivet_ng/rivetCore.c: add const specifier to variable definition + +2018-11-18 Massimo Manghi <mxman...@apache.org> + * src/mod_rivet_ng/rivetCore.c: stripping the namespace in the commands + implemented by Rivet_Var (fixes bug #62926) + * tests/post.test: add test to prevent the POST and GET arguments + crosstalk + * tests/fqrivet_var.tcl: test fully qualified ::rivet::var[xxx] commands + +2018-11-18 Massimo Manghi <mxman...@apache.org> + * : version 3.0.3 released + * doc/rivet.xml.in: print manual the full version in the cover page + 2018-11-04 Massimo Manghi <mxman...@apache.org> * rivet/rivet-tcl/xml.tcl: New ::rivet::xml command simplified and new construct for self closing elements diff --git a/VERSION b/VERSION index 75a22a2..fd2a018 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.3 +3.1.0 diff --git a/configure.ac b/configure.ac index 8eba832..952ab5d 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ dnl # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- -AC_INIT([Rivet],[3.0.3]) +AC_INIT([Rivet],[3.1.0]) TEA_INIT([3.9]) # we are storing here the configure command line, as recursive diff --git a/doc/rivet.xml b/doc/rivet.xml index acfc0ba..7324d0a 100644 --- a/doc/rivet.xml +++ b/doc/rivet.xml @@ -35,21 +35,22 @@ <!ENTITY asciiglyphs.xml SYSTEM "xml/asciiglyphs.xml" > <!ENTITY lazybridge.xml SYSTEM "xml/lazybridge.xml" > <!ENTITY formbroker.xml SYSTEM "xml/formbroker.xml" > - <!ENTITY version "3.0" > - <!ENTITY fullversion "3.0.3" > - <!ENTITY version2-series "2.0,2.1,2.2,2.3" > - <!ENTITY version2-generic "2.x" > - <!ENTITY version30 "3.0" > + <!ENTITY version "3.1" > + <!ENTITY fullversion "3.1.0" > + <!ENTITY version2-series "2.0,2.1,2.2,2.3" > + <!ENTITY version2-generic "2.x" > + <!ENTITY version30 "3.0" > + <!ENTITY version31 "3.1" > <!ENTITY tcltk-url "http://www.tcl.tk/" > <!ENTITY apache-url "http://httpd.apache.org" > <!ENTITY apachedoc-vhost "https://httpd.apache.org/docs/2.4/vhosts" > - <!ENTITY apachedoc-mpm "https://httpd.apache.org/docs/2.4/mpm.html" > - <!ENTITY apachedoc-prefork "https://httpd.apache.org/docs/2.4/mod/prefork.html" > - <!ENTITY apachedoc-worker "https://httpd.apache.org/docs/2.4/mod/worker.html" > - <!ENTITY apachedoc-event "https://httpd.apache.org/docs/2.4/mod/event.html" > - <!ENTITY apachedoc-winnt "https://httpd.apache.org/docs/2.4/mod/mpm_winnt.html" > + <!ENTITY apachedoc-mpm "https://httpd.apache.org/docs/2.4/mpm.html" > + <!ENTITY apachedoc-prefork "https://httpd.apache.org/docs/2.4/mod/prefork.html" > + <!ENTITY apachedoc-worker "https://httpd.apache.org/docs/2.4/mod/worker.html" > + <!ENTITY apachedoc-event "https://httpd.apache.org/docs/2.4/mod/event.html" > + <!ENTITY apachedoc-winnt "https://httpd.apache.org/docs/2.4/mod/mpm_winnt.html" > <!ENTITY apachedoc-docroot "https://httpd.apache.org/docs/2.4/mod/core.html#documentroot" > - <!ENTITY apachedoc-alias "https://httpd.apache.org/docs/2.4/mod/mod_alias.html" > + <!ENTITY apachedoc-alias "https://httpd.apache.org/docs/2.4/mod/mod_alias.html" > <!ENTITY apachedoc-rewrite "https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html" > <!ENTITY apachedoc-perftuning "https://httpd.apache.org/docs/2.4/misc/perf-tuning.html" > ]> @@ -89,7 +90,7 @@ </articleinfo> <para> - This manual was generated on <?dbtimestamp format="A Y-m-d X" ?>. + This manual is released as part of Apache/Rivet &fullversion; (<?dbtimestamp format="A Y-m-d X" ?>). </para> <!-- Introduction --> diff --git a/doc/rivet.xml.in b/doc/rivet.xml.in index 18bb111..e24504e 100644 --- a/doc/rivet.xml.in +++ b/doc/rivet.xml.in @@ -35,21 +35,22 @@ <!ENTITY asciiglyphs.xml SYSTEM "xml/asciiglyphs.xml" > <!ENTITY lazybridge.xml SYSTEM "xml/lazybridge.xml" > <!ENTITY formbroker.xml SYSTEM "xml/formbroker.xml" > - <!ENTITY version "@INIT_VERSION@" > + <!ENTITY version "@INIT_VERSION@" > <!ENTITY fullversion "@PACKAGE_VERSION@" > - <!ENTITY version2-series "2.0,2.1,2.2,2.3" > - <!ENTITY version2-generic "2.x" > - <!ENTITY version30 "3.0" > + <!ENTITY version2-series "2.0,2.1,2.2,2.3" > + <!ENTITY version2-generic "2.x" > + <!ENTITY version30 "3.0" > + <!ENTITY version31 "3.1" > <!ENTITY tcltk-url "http://www.tcl.tk/" > <!ENTITY apache-url "http://httpd.apache.org" > <!ENTITY apachedoc-vhost "https://httpd.apache.org/docs/2.4/vhosts" > - <!ENTITY apachedoc-mpm "https://httpd.apache.org/docs/2.4/mpm.html" > - <!ENTITY apachedoc-prefork "https://httpd.apache.org/docs/2.4/mod/prefork.html" > - <!ENTITY apachedoc-worker "https://httpd.apache.org/docs/2.4/mod/worker.html" > - <!ENTITY apachedoc-event "https://httpd.apache.org/docs/2.4/mod/event.html" > - <!ENTITY apachedoc-winnt "https://httpd.apache.org/docs/2.4/mod/mpm_winnt.html" > + <!ENTITY apachedoc-mpm "https://httpd.apache.org/docs/2.4/mpm.html" > + <!ENTITY apachedoc-prefork "https://httpd.apache.org/docs/2.4/mod/prefork.html" > + <!ENTITY apachedoc-worker "https://httpd.apache.org/docs/2.4/mod/worker.html" > + <!ENTITY apachedoc-event "https://httpd.apache.org/docs/2.4/mod/event.html" > + <!ENTITY apachedoc-winnt "https://httpd.apache.org/docs/2.4/mod/mpm_winnt.html" > <!ENTITY apachedoc-docroot "https://httpd.apache.org/docs/2.4/mod/core.html#documentroot" > - <!ENTITY apachedoc-alias "https://httpd.apache.org/docs/2.4/mod/mod_alias.html" > + <!ENTITY apachedoc-alias "https://httpd.apache.org/docs/2.4/mod/mod_alias.html" > <!ENTITY apachedoc-rewrite "https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html" > <!ENTITY apachedoc-perftuning "https://httpd.apache.org/docs/2.4/misc/perf-tuning.html" > ]> @@ -89,7 +90,7 @@ </articleinfo> <para> - This manual was generated on <?dbtimestamp format="A Y-m-d X" ?>. + This manual is released as part of Apache/Rivet &fullversion; (<?dbtimestamp format="A Y-m-d X" ?>). </para> <!-- Introduction --> diff --git a/rivet/init.tcl b/rivet/init.tcl index bff8e28..41438f3 100644 --- a/rivet/init.tcl +++ b/rivet/init.tcl @@ -16,7 +16,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -package require rivetlib 3.0 +package require rivetlib 3.1 # the ::rivet namespace is created in mod_rivet_commoc.c:Rivet_PerInterpInit # namespace eval ::rivet {} ; ## create namespace @@ -259,4 +259,4 @@ proc ::Rivet::tcl_commands_export_list {tclpath} { ::Rivet::init -package provide Rivet 3.0 +package provide Rivet 3.1 diff --git a/src/mod_rivet_ng/rivetCore.c b/src/mod_rivet_ng/rivetCore.c index 7650cbe..66cb9d8 100644 --- a/src/mod_rivet_ng/rivetCore.c +++ b/src/mod_rivet_ng/rivetCore.c @@ -638,10 +638,11 @@ TCL_CMD_HEADER ( Rivet_LoadHeaders ) TCL_CMD_HEADER ( Rivet_Var ) { rivet_thread_private* private; - char* cmd; + const char* cmd; char* command; Tcl_Obj* result = NULL; int source; + register const char *p; THREAD_PRIVATE_DATA(private) CHECK_REQUEST_REC(private,"::rivet::var,::rivet::var_post,::rivet::var_qs") @@ -657,6 +658,26 @@ TCL_CMD_HEADER ( Rivet_Var ) result = Tcl_NewObj(); /* determine if var_qs, var_post or var was called */ + + /* first of all we have to skip the namespace string at the beginning of the command: + * + * This fragment of code is taken from tcl 8.6.6 (tclNamesp.c) and it's part of the + * function implementing Tcl "namespace tail", as such it should be authoritative + * regarding the determination of the namespace stripped command name + */ + + for (p = cmd; *p != '\0'; p++) { + /* empty body */ + } + + while (--p > cmd) { + if ((*p == ':') && (*(p-1) == ':')) { + p++; /* Just after the last "::" */ + break; + } + } + cmd = p; + if (!strcmp(cmd, "var_qs")) source = VAR_SRC_QUERYSTRING; else if (!strcmp(cmd, "var_post")) source = VAR_SRC_POST; else source = VAR_SRC_ALL; diff --git a/tests/fqrivet_var.tcl b/tests/fqrivet_var.tcl new file mode 100644 index 0000000..8a5eedf --- /dev/null +++ b/tests/fqrivet_var.tcl @@ -0,0 +1,40 @@ +switch [::rivet::var_qs get t1] { + + 1 { + set qsvariables [dict create {*}[::rivet::var_qs all]] + set postvariables [dict create {*}[::rivet::var_post all]] + + set qsvar {qsarg1 qsarg2} + set postvar {postarg1 postarg2} + + set qs "" + set post "" + foreach v $qsvar {lappend qs $v [dict get $qsvariables $v]} + foreach v $postvar {lappend post $v [dict get $postvariables $v]} + puts -nonewline "var_qs = $qs\nvar_post = $post" + } + 2 { + #::rivet::parray server + # GET request: no var_post variables are supposed to be returned + + set qsvariables [dict create {*}[::rivet::var_qs all]] + set postvariables [dict create {*}[::rivet::var_post all]] + + if {[dict exists $postvariables qsarg1] || [dict exists $postvariables qsarg2]} { + puts "KO: [::rivet::var_post all]" + } else { + puts -nonewline "OK" + } + + } + 3 { + set qsvariables [dict create {*}[::rivet::var_qs all]] + set postvariables [dict create {*}[::rivet::var_post all]] + + if {[dict exists $qsvariables postarg1] || [dict exists $qsvariables postarg2]} { + puts "KO: $qsvariables" + } else { + puts -nonewline "OK" + } + } +} diff --git a/tests/post.test b/tests/post.test index 77e9bf8..8fed8dc 100644 --- a/tests/post.test +++ b/tests/post.test @@ -37,3 +37,26 @@ set testfilename1 post.rvt regexp -line {^\[::rivet::var_post get foobar\] = goober$} [ ::http::data $page ] match set match } {[::rivet::var_post get foobar] = goober} + +set rivetscript "${urlbase}fqrivet_var.tcl" + +::tcltest::test postvariables-5.1 {::rivet::var_qs and ::rivet::var_post} { + set page [::http::geturl "${rivetscript}?qsarg1=val1&qsarg2=val2&t1=1" \ + -query [::http::formatQuery postarg1 val1 postarg2 val2]] + set match [::http::data $page] + set match +} {var_qs = qsarg1 val1 qsarg2 val2 +var_post = postarg1 val1 postarg2 val2} + +::tcltest::test postvariables-5.2 {::rivet::var_post and ::rivet::var_qs crosstalk 1} { + set page [::http::geturl "${rivetscript}?qsarg1=val1&qsarg2=val2&t1=2"] + set match [::http::data $page] + set match +} {OK} + +::tcltest::test postvariables-5.3 {::rivet::var_post and ::rivet::var_qs crosstalk 2} { + set page [::http::geturl "${rivetscript}?t1=3" \ + -query [::http::formatQuery postarg1 val1 postarg2 val2]] + set match [::http::data $page] + set match +} {OK} --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@tcl.apache.org For additional commands, e-mail: commits-h...@tcl.apache.org