This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a commit to branch 2.4
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git

commit d7fa2c78aee3fae2c3232bd46b53bf95d6249b9f
Author: Massimo Manghi <mxman...@apache.org>
AuthorDate: Sat Nov 24 09:09:57 2018 +0100

    branch 2.4 created and preparing to release 2.4.0
---
 .gitignore                  | 41 +++++++++++++++++++++++++
 ChangeLog                   | 20 +++++++++++++
 Makefile.in                 |  2 +-
 VERSION                     |  2 +-
 configure.ac                |  2 +-
 doc/rivet.xml               |  2 +-
 src/channel/rivetChannel.c  | 30 +++++++++++--------
 src/librivet/rivetPkgInit.c | 73 +++++++++++++++++++++------------------------
 src/rivetcmds/rivetCore.c   | 21 +++++++++++++
 tests/fqrivet_var.tcl       | 40 +++++++++++++++++++++++++
 tests/post.test             | 23 ++++++++++++++
 11 files changed, 200 insertions(+), 56 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d6f9347
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,41 @@
+Makefile.in
+doc/Makefile.in
+src/Makefile.in
+aclocal.m4
+autom4te.cache/
+configure
+Makefile
+_configs.sed
+config.h
+config.h.in
+config.log
+config.status
+rivet_config.h
+doc/Makefile
+doc/convert_examples.tcl
+doc/graphics
+doc/html/
+libtool
+src/Makefile
+src/librivet/.deps/
+src/mod_rivet_ng/.deps/
+src/parser/.deps/
+src/request/.deps/
+stamp-h1
+*~
+*.libs/
+*.dirstamp
+*.lo
+*.la
+*.swp
+tags
+tests/access_log
+tests/apachelog.txt
+tests/error_log
+tests/htaccess2
+tests/httpd.pid
+tests/redirect_code.txt
+tests/rivet/
+tests/server.conf
+tests/test.conf
+tests/uploadedjpeg.jpg
diff --git a/ChangeLog b/ChangeLog
index 31f9945..5241082 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2018-11-24 Massimo Manghi <mxman...@apache.org>
+    * VERSION,configure.ac: moving to version 2.4.0 to mark
+    potential regressions introduced by fixing bug #29692
+    * .gitignore: add file to ignore temporary files to be
+    kept out of distribution
+    * tests/fqrivet_var.tcl: test script for FQ var,var_post,var_qs
+    * src/channel/rivetChannel.c: new copyright statement
+
+2018-11-20 Massimo Manghi <mxman...@apache.org>
+    * doc/rivet.xml: changed release notice
+
+2018-11-19 Massimo Manghi <mxman...@apache.org>
+    * VERSION,configure.ac: bumping version to 2.3.7
+    * src/rivetcmds/rivetCore.c: fix wrong discrimination between
+    ::rivet::var_qs,::rivet::var_post that lead to overlapping
+    functionalities
+    * src/librivet/rivetPkgInit.c: merging from 3.0 new namespace
+    determination that makes librivet independent from the module
+    globals
+
 2018-04-01 Massimo Manghi <mxman...@apache.org>
     * VERSION,configure.ac: bumping version to 2.3.6
 
diff --git a/Makefile.in b/Makefile.in
index c92760a..4f3914a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -17,7 +17,7 @@
 #
 # top-level Makefile.am for Apache Rivet: gets turned into a Makefile.in by 
automake
 #
-# $Id: Makefile.am 1517859 2013-08-27 16:08:31Z mxmanghi $
+# $Id$
 #
 # 2007/12/25: Added target uninistall-local that removes the tcl stuff 
(mxmanghi)
 # 2010/06/22: target instal-data-local searches for pkgIndex.tcl files and 
deletes them
diff --git a/VERSION b/VERSION
index e75da3e..197c4d5 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.3.6
+2.4.0
diff --git a/configure.ac b/configure.ac
index 5cd2e34..c306c0c 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],[2.3.6])
+AC_INIT([Rivet],[2.4.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 d9e7181..46924fb 100644
--- a/doc/rivet.xml
+++ b/doc/rivet.xml
@@ -69,7 +69,7 @@
   </articleinfo>
 
   <para>
-    Document revision: $Revision$, last modified <?dbtimestamp format="Y-m-d 
X" ?>$ by $Author$.
+    Document released as part of Rivet 2.3.6 (<?dbtimestamp format="Y-m-d X" 
?>).
   </para>
 
     <!-- Introduction -->
diff --git a/src/channel/rivetChannel.c b/src/channel/rivetChannel.c
index ff3c1db..0f66a69 100644
--- a/src/channel/rivetChannel.c
+++ b/src/channel/rivetChannel.c
@@ -1,18 +1,22 @@
 /* rivetChannel.c -- describes the mod_rivet Tcl output channel. */
 
-/* Copyright 2002-2004 The Apache Software Foundation
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
+/*
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 */
 
 /* Rivet config */
diff --git a/src/librivet/rivetPkgInit.c b/src/librivet/rivetPkgInit.c
index d96cf48..1691c32 100644
--- a/src/librivet/rivetPkgInit.c
+++ b/src/librivet/rivetPkgInit.c
@@ -2,20 +2,24 @@
  * rivetPkgInit.c - Initialize all of the Rivet commands into a Tcl interp.
  */
 
-/* Copyright 2002-2004 The Apache Software Foundation
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
+/*
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+ */
 
 /* Rivet config */
 #ifdef HAVE_CONFIG_H
@@ -23,8 +27,13 @@
 #endif
 
 #include <tcl.h>
+/* Function prototypes are defined with EXTERN. Since we are in the same DLL,
+ * no need to keep this extern... */
+#ifdef EXTERN
+#   undef EXTERN
+#   define EXTERN
+#endif /* EXTERN */
 #include "rivet.h"
-#include "mod_rivet.h"
 
 /*-----------------------------------------------------------------------------
  * Rivet_GetNamespace --
@@ -49,25 +58,16 @@
 
 #if RIVET_NAMESPACE_EXPORT == 1
 
-Tcl_Namespace* Rivet_GetNamespace( Tcl_Interp* interp)
+Tcl_Namespace* 
+Rivet_GetNamespace( Tcl_Interp* interp)
 {
-    rivet_interp_globals *globals; 
     Tcl_Namespace *rivet_ns;
 
-    globals = Tcl_GetAssocData(interp, "rivet", NULL);
-    if (globals != NULL)
-    {
-        rivet_ns = globals->rivet_ns;
-    }
-    else
+    rivet_ns = Tcl_FindNamespace(interp,RIVET_NS,NULL,TCL_GLOBAL_ONLY);
+    if (rivet_ns == NULL) 
     {
-//      fprintf(stderr,"no Associated data found, running standalone\n");
-        rivet_ns = Tcl_FindNamespace(interp, RIVET_NS, NULL, TCL_GLOBAL_ONLY);
-        if (rivet_ns == NULL) {
-            /* The namespace does not exist, create it */
-            rivet_ns = Tcl_CreateNamespace (interp, RIVET_NS, NULL,
-                                            (Tcl_NamespaceDeleteProc *)NULL);
-        }
+        rivet_ns = Tcl_CreateNamespace (interp,RIVET_NS,NULL,
+                                        (Tcl_NamespaceDeleteProc *)NULL);
     }
 
     return rivet_ns;
@@ -86,12 +86,9 @@ Tcl_Namespace* Rivet_GetNamespace( Tcl_Interp* interp)
  *-----------------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Rivetlib_Init( Tcl_Interp *interp )
 {
-#if RIVET_NAMESPACE_EXPORT == 1
-    //Tcl_Namespace *rivet_ns; 
-#endif
 
 #ifdef USE_TCL_STUBS
     if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { 
@@ -104,16 +101,13 @@ Rivetlib_Init( Tcl_Interp *interp )
     Rivet_InitList (interp);
     Rivet_InitCrypt(interp);
     Rivet_InitWWW  (interp);
-#if RIVET_NAMESPACE_EXPORT == 1
-    //rivet_ns = Rivet_GetNamespace(interp);
-    //Tcl_Export(interp,rivet_ns,"*",0);
-#endif
 
     return Tcl_PkgProvide( interp, RIVETLIB_TCL_PACKAGE, RIVET_VERSION );
 }
 
 /*-----------------------------------------------------------------------------
  * Rivetlib_SafeInit --
+ *
  *   Install the commands provided by librivet that are believed to be
  *   safe for use in safe interpreters, into a safe interpreter.
  *
@@ -124,9 +118,10 @@ Rivetlib_Init( Tcl_Interp *interp )
  *-----------------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Rivetlib_SafeInit( Tcl_Interp *interp )
 {
+
 #ifdef USE_TCL_STUBS
     if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { 
 #else
diff --git a/src/rivetcmds/rivetCore.c b/src/rivetcmds/rivetCore.c
index 2e2dd29..2d31dc3 100644
--- a/src/rivetcmds/rivetCore.c
+++ b/src/rivetcmds/rivetCore.c
@@ -560,6 +560,7 @@ TCL_CMD_HEADER ( Rivet_LoadHeaders )
 TCL_CMD_HEADER ( Rivet_Var )
 {
     char *cmd;
+    char *p;
     char *command;
     Tcl_Obj *result = NULL;
     int source;
@@ -578,6 +579,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

Reply via email to