You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2015/11/28 00:54:36 UTC
svn commit: r1716933 - in /tcl/rivet/branches/2.2: ./ doc/xml/ rivet/
rivet/packages/hexglyphs/ rivet/rivet-tcl/ src/ src/apache-2/ src/librivet/
src/rivetcmds/ tests/
Author: mxmanghi
Date: Fri Nov 27 23:54:35 2015
New Revision: 1716933
URL: http://svn.apache.org/viewvc?rev=1716933&view=rev
Log:
* 2.2: bringing this brack back to r1702115. Changes done after Sept 9 2015
are now in branches/2.3
Modified:
tcl/rivet/branches/2.2/ChangeLog
tcl/rivet/branches/2.2/Makefile.in
tcl/rivet/branches/2.2/configure.ac
tcl/rivet/branches/2.2/doc/xml/commands.xml
tcl/rivet/branches/2.2/rivet/init.tcl
tcl/rivet/branches/2.2/rivet/init.tcl.in
tcl/rivet/branches/2.2/rivet/packages/hexglyphs/hexglyphs.tcl
tcl/rivet/branches/2.2/rivet/rivet-tcl/catch.tcl
tcl/rivet/branches/2.2/rivet/rivet-tcl/tclIndex
tcl/rivet/branches/2.2/src/apache-2/mod_rivet.c
tcl/rivet/branches/2.2/src/apache-2/mod_rivet.h
tcl/rivet/branches/2.2/src/librivet/rivetCrypt.c
tcl/rivet/branches/2.2/src/librivet/rivetList.c
tcl/rivet/branches/2.2/src/librivet/rivetPkgInit.c
tcl/rivet/branches/2.2/src/librivet/rivetWWW.c
tcl/rivet/branches/2.2/src/rivet.h
tcl/rivet/branches/2.2/src/rivetcmds/rivetCore.c
tcl/rivet/branches/2.2/tests/bailout.test
tcl/rivet/branches/2.2/tests/exit.tcl
tcl/rivet/branches/2.2/tests/redirect.test
tcl/rivet/branches/2.2/tests/rivet.test
Modified: tcl/rivet/branches/2.2/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/ChangeLog?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/ChangeLog (original)
+++ tcl/rivet/branches/2.2/ChangeLog Fri Nov 27 23:54:35 2015
@@ -1,39 +1,6 @@
-2015-11-25 Massimo Manghi <mx...@apache.org>
- * src/rivet.h: add macro RIVET_EXPORT_COMMAND (wraps Tcl_Export)
- * src/librivet/rivet[WWW|List|Crypt].c: proper way to put these commands
- on the export list
- * src/rivetcmds/rivetCore.c: Commands are now put explicitly on the
- export list (if build with --enable-rivet-commands-export)
- * rivet/init.tcl: removed -force switch when importing the ::rivet command
- set. Rationalization of Tcl commands export list
- * doc/xml/command.xml: add manual page for ::rivet::exit
- * tests/bailout.test: add test for bailout commands ::rivet::abort_page
- and ::rivet::exit
- * configure.ac: add INIT_VERSION symbol substitution
-
-2015-11-21 Massimo Manghi <mx...@apache.org>
- * src/rivetcmds/rivetCore.c: return EXITPAGECODE when ::rivet::exit
- is called.Add [::rivet::abort_page -exiting] exit condition detection
-
-2015-11-20 Massimo Manghi <mx...@apache.org>
- * rivet/rivet-tcl/catch.tcl: new command [::rivet::catch ...] wraps
- the core command but returns an error anyway if raised by
- either [::rivet::abort_page] or [::rivet::exit]
-
-2015-11-18 Massimo Manghi <mx...@apache.org>
- * rivet/packages/hexglyphs/hexglyphs.tcl: now printing the whole
- alphabet and some puntuation character
- * src/rivetcmd/rivetCore.c: Implementing command exit
- * src/apache-2/mod_rivet.c: New command ::exit required the flag
- exit_process be checked to see if a child process must exit and
- also to treat exit like an ::rivet::abort_page invocation that
- eventually causes the process to go away. Abort page conditions now
- checked through flag abort_page
- * rivet/init.tcl.in: now reimplementing the core command exit
-
-2015-10-21 Massimo Manghi <mx...@apache.org>
- * rivet/packages/hexglyphs/hexglyphs.tcl: package to create ASCII art
- glyphs of hexadecimal characters
+2015-11-27 Massimo Manghi <mx...@apache.org>
+ * 2.2: bringing this brack back to r1702115. Changes done after Sept 9 2015
+ are now in branches/2.3
2015-09-09 Massimo Manghi <mx...@apache.org>
* src/apache-2/mod_rivet.c: We don't delete the Tcl interpreter anymore,
Modified: tcl/rivet/branches/2.2/Makefile.in
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/Makefile.in?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/Makefile.in (original)
+++ tcl/rivet/branches/2.2/Makefile.in Fri Nov 27 23:54:35 2015
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -24,7 +24,17 @@
# before invoking pkg_mkIndex.
# 2013/01/20: removing libtool created .la files
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -88,18 +98,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/config.h.in $(top_srcdir)/rivet/init.tcl.in \
- ChangeLog tclconfig/ChangeLog INSTALL README TODO \
- tclconfig/compile tclconfig/config.guess tclconfig/config.sub \
- tclconfig/depcomp tclconfig/install-sh tclconfig/missing \
- tclconfig/ltmain.sh $(top_srcdir)/tclconfig/compile \
- $(top_srcdir)/tclconfig/config.guess \
- $(top_srcdir)/tclconfig/config.sub \
- $(top_srcdir)/tclconfig/install-sh \
- $(top_srcdir)/tclconfig/ltmain.sh \
- $(top_srcdir)/tclconfig/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
$(top_srcdir)/m4/ax_split_version.m4 \
@@ -109,6 +107,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@@ -172,6 +172,17 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(top_srcdir)/rivet/init.tcl.in \
+ $(top_srcdir)/tclconfig/compile \
+ $(top_srcdir)/tclconfig/config.guess \
+ $(top_srcdir)/tclconfig/config.sub \
+ $(top_srcdir)/tclconfig/install-sh \
+ $(top_srcdir)/tclconfig/ltmain.sh \
+ $(top_srcdir)/tclconfig/missing ChangeLog INSTALL README TODO \
+ tclconfig/ChangeLog tclconfig/compile tclconfig/config.guess \
+ tclconfig/config.sub tclconfig/depcomp tclconfig/install-sh \
+ tclconfig/ltmain.sh tclconfig/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -261,7 +272,6 @@ EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
-INIT_VERSION = @INIT_VERSION@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -398,6 +408,7 @@ psdir = @psdir@
rivet_channel = @rivet_channel@
rivet_core = @rivet_core@
rivet_core_cmds = @rivet_core_cmds@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -437,7 +448,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -670,15 +680,15 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@@ -714,17 +724,17 @@ distcheck: dist
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=.. --prefix="$$dc_install_base" \
+ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -902,6 +912,8 @@ uninstall-am: uninstall-local
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-local
+.PRECIOUS: Makefile
+
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
Modified: tcl/rivet/branches/2.2/configure.ac
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/configure.ac?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/configure.ac (original)
+++ tcl/rivet/branches/2.2/configure.ac Fri Nov 27 23:54:35 2015
@@ -791,7 +791,6 @@ VERSION=${PACKAGE_VERSION}
AX_SPLIT_VERSION
AC_DEFINE_UNQUOTED(TCL_PACKAGE_VERSION,"${AX_MAJOR_VERSION}.${AX_MINOR_VERSION}",[Rivet Tcl package version])
AC_MSG_NOTICE([Rivet package version is ${AX_MAJOR_VERSION}.${AX_MINOR_VERSION}])
-AC_SUBST(INIT_VERSION,"${AX_MAJOR_VERSION}.${AX_MINOR_VERSION}")
if test $import_rivet_commands = "yes"; then
AC_MSG_NOTICE([forcing Rivet to export commands from ::rivet namespace])
@@ -819,7 +818,7 @@ AC_SUBST(TCL_PACKAGE_PATH)
# You may alternatively have a special pkgIndex.tcl.in or other files
# which require substituting the AC variables in. Include these here.
#--------------------------------------------------------------------
-AC_CONFIG_FILES([Makefile src/Makefile src/parser/Makefile doc/Makefile doc/convert_examples.tcl rivet/init.tcl])
+AC_CONFIG_FILES([Makefile src/Makefile rivet/init.tcl src/parser/Makefile doc/Makefile doc/convert_examples.tcl])
#case $apache_version_dir in
# apache-1) AC_CONFIG_FILES([Makefile src/Makefile src/apache-1/Makefile doc/Makefile]) ;;
Modified: tcl/rivet/branches/2.2/doc/xml/commands.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/doc/xml/commands.xml?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/doc/xml/commands.xml (original)
+++ tcl/rivet/branches/2.2/doc/xml/commands.xml Fri Nov 27 23:54:35 2015
@@ -569,56 +569,6 @@
</refsect1>
</refentry>
- <refentry id="exit">
- <refnamediv>
- <refname>exit</refname>
- <refpurpose>terminate execution and child process</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>::rivet::exit</command>
- <arg>code</arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- Replaces Tcl's <command>exit</command> core command. <command>::rivet::exit</command>
- interrupts execution of the current script and passes execution to AbortScript if
- such script is set. After AbortScript has finished and request processing completed
- the child process is forced to exit by calling Tcl_Exit producing the same final
- effect of the core command. During an <command>AbortScript</command> execution the
- exit condition can be detected
- <programlisting>if {[<command>::rivet::abort_page -exiting</command>]} {
-...handle exit condition
-}</programlisting>
- </para>
- <para>
- <command>::rivet::exit</command> has a single optional argument <arg>code</arg>. This
- value must be a positive integer number to be passed to Tcl_Exit. If any other value is
- given <arg>code</arg> is set to 0. The exit code can be obtained from the dictionary
- returned by <command>::rivet::abort_code</command>
- </para>
- <programlisting>[::rivet::abort_code]
-<== return_code <arg>code</arg> error_code exit</programlisting>
- <para>
- We support this command in order to have a gentle way to terminate a request processing
- before actually exit the child process and avoid an abrupt interruption of a request that
- might leave an application in a inconsistent state. In some cases <command>::rivet::exit</command>
- could be the only way to exit a process and force the Apache HTTP web server to start
- a fresh one. Moreover the core <command>exit</command> could be called from third parties
- software and you may not be aware of it. We thus decided to trap this command and give it
- the most gentle behavior still preserving the its basic purpose.
- </para>
- <note>
- Nonetheless we discourage the programmer to use such command, and suggest to focus on proper
- application design and avoid such a drastic way to bail out.
- If you need to restart the child processes from time to time we recommend to check the
- MaxRequests parameter in the
- <ulink url="https://httpd.apache.org/docs/2.4/mod/prefork.html">prefork MPM documentation</ulink>
- </note>
- </refsect1>
- </refentry>
<refentry id="headers">
<refnamediv>
@@ -627,17 +577,17 @@
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>::rivet::headers</command>
- <group choice="req">
- <arg>get</arg>
- <arg>set</arg>
- <arg>redirect</arg>
- <arg>add</arg>
- <arg>type</arg>
- <arg>numeric</arg>
- </group>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::headers</command>
+ <group choice="req">
+ <arg>get</arg>
+ <arg>set</arg>
+ <arg>redirect</arg>
+ <arg>add</arg>
+ <arg>type</arg>
+ <arg>numeric</arg>
+ </group>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
Modified: tcl/rivet/branches/2.2/rivet/init.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/rivet/init.tcl?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/rivet/init.tcl (original)
+++ tcl/rivet/branches/2.2/rivet/init.tcl Fri Nov 27 23:54:35 2015
@@ -40,19 +40,25 @@ namespace eval ::Rivet {
set dir $tclpath
source [file join $tclpath tclIndex]
-
- # Rivet Tcl commands not meant to go onto the export list must
- # be unset from auto_index here
-
- unset auto_index(::rivet::catch)
}
-
+
set command_list [namespace eval ::rivet_temp {array names auto_index}]
+ # commands in 'command_list' are prefixed with ::rivet, so we have to
+ # remove it to build an export list
+
+ set export_list {}
+ foreach c $command_list {
+ if {[regexp {::rivet::(.*)} $c m cmd]} {
+ lappend export_list $cmd
+# namespace eval ::rivet [list namespace export $cmd]
+ }
+ }
+
# we won't left anything behind
namespace delete ::rivet_temp
- return $command_list
+ return $export_list
}
###
@@ -119,7 +125,7 @@ namespace eval ::Rivet {
## we keep in ::rivet::export_list a list of importable commands
- namespace eval ::rivet [list set cmd_export_list [tcl_commands_export_list $tclpath]]
+ namespace eval ::rivet [list set export_list [tcl_commands_export_list $tclpath]]
namespace eval ::rivet {
## init.tcl is run by mod_rivet (which creates the ::rivet namespace) but it gets run
@@ -129,18 +135,9 @@ namespace eval ::Rivet {
if {[info exists module_conf(export_namespace_commands)] && \
$module_conf(export_namespace_commands)} {
- # commands in 'command_list' are prefixed with ::rivet, so we have to
- # remove it to build an export list
-
- set export_list {}
- foreach c $cmd_export_list {
- lappend export_list [namespace tail $c]
- }
-
- #puts stderr "exporting $export_list"
eval namespace export $export_list
- }
+ }
}
## Add the packages directory to the auto_path.
## If we have a packages$tcl_version directory
@@ -169,18 +166,6 @@ namespace eval ::Rivet {
} ;## namespace eval ::Rivet
-## eventually we have to divert Tcl ::exit to ::rivet::exit
-
-rename ::exit ::Rivet::tclcore_exit
-proc ::exit {code} {
-
- if {[string is integer $code]} {
- eval ::rivet::exit $code
- } else {
- eval ::rivet::exit 0
- }
-
-}
## Rivet 2.1.x supports Tcl >= 8.5, therefore there's no more need for
## the command incr0, as the functionality of creating a not yet
@@ -194,15 +179,15 @@ interp alias {} ::incr0 {} incr
::Rivet::init
## And now we get to the import of the whole ::rivet namespace.
+## Some commands (namely lassign) replace the native lassign command
+## so we have to use the -force switch
# Do we actually want to import everything? If Rivet was configured
# to import the ::rivet namespace for compatibility we do it right away.
# This option is not guaranteed to be supported in future versions.
if {[info exists module_conf(import_rivet_commands)] && $module_conf(import_rivet_commands)} {
-
- namespace eval :: { namespace import ::rivet::* }
-
+ namespace eval :: { namespace import -force ::rivet::* }
}
array unset module_conf
Modified: tcl/rivet/branches/2.2/rivet/init.tcl.in
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/rivet/init.tcl.in?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/rivet/init.tcl.in (original)
+++ tcl/rivet/branches/2.2/rivet/init.tcl.in Fri Nov 27 23:54:35 2015
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-package provide Rivet @INIT_VERSION@
+package provide Rivet 2.2
namespace eval ::Rivet {
@@ -40,19 +40,25 @@ namespace eval ::Rivet {
set dir $tclpath
source [file join $tclpath tclIndex]
-
- # Rivet Tcl commands not meant to go onto the export list must
- # be unset from auto_index here
-
- unset auto_index(::rivet::catch)
}
-
+
set command_list [namespace eval ::rivet_temp {array names auto_index}]
+ # commands in 'command_list' are prefixed with ::rivet, so we have to
+ # remove it to build an export list
+
+ set export_list {}
+ foreach c $command_list {
+ if {[regexp {::rivet::(.*)} $c m cmd]} {
+ lappend export_list $cmd
+# namespace eval ::rivet [list namespace export $cmd]
+ }
+ }
+
# we won't left anything behind
namespace delete ::rivet_temp
- return $command_list
+ return $export_list
}
###
@@ -119,7 +125,7 @@ namespace eval ::Rivet {
## we keep in ::rivet::export_list a list of importable commands
- namespace eval ::rivet [list set cmd_export_list [tcl_commands_export_list $tclpath]]
+ namespace eval ::rivet [list set export_list [tcl_commands_export_list $tclpath]]
namespace eval ::rivet {
## init.tcl is run by mod_rivet (which creates the ::rivet namespace) but it gets run
@@ -129,18 +135,9 @@ namespace eval ::Rivet {
if {[info exists module_conf(export_namespace_commands)] && \
$module_conf(export_namespace_commands)} {
- # commands in 'command_list' are prefixed with ::rivet, so we have to
- # remove it to build an export list
-
- set export_list {}
- foreach c $cmd_export_list {
- lappend export_list [namespace tail $c]
- }
-
- #puts stderr "exporting $export_list"
eval namespace export $export_list
- }
+ }
}
## Add the packages directory to the auto_path.
## If we have a packages$tcl_version directory
@@ -169,18 +166,6 @@ namespace eval ::Rivet {
} ;## namespace eval ::Rivet
-## eventually we have to divert Tcl ::exit to ::rivet::exit
-
-rename ::exit ::Rivet::tclcore_exit
-proc ::exit {code} {
-
- if {[string is integer $code]} {
- eval ::rivet::exit $code
- } else {
- eval ::rivet::exit 0
- }
-
-}
## Rivet 2.1.x supports Tcl >= 8.5, therefore there's no more need for
## the command incr0, as the functionality of creating a not yet
@@ -194,15 +179,15 @@ interp alias {} ::incr0 {} incr
::Rivet::init
## And now we get to the import of the whole ::rivet namespace.
+## Some commands (namely lassign) replace the native lassign command
+## so we have to use the -force switch
# Do we actually want to import everything? If Rivet was configured
# to import the ::rivet namespace for compatibility we do it right away.
# This option is not guaranteed to be supported in future versions.
if {[info exists module_conf(import_rivet_commands)] && $module_conf(import_rivet_commands)} {
-
- namespace eval :: { namespace import ::rivet::* }
-
+ namespace eval :: { namespace import -force ::rivet::* }
}
array unset module_conf
Modified: tcl/rivet/branches/2.2/rivet/packages/hexglyphs/hexglyphs.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/rivet/packages/hexglyphs/hexglyphs.tcl?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/rivet/packages/hexglyphs/hexglyphs.tcl (original)
+++ tcl/rivet/branches/2.2/rivet/packages/hexglyphs/hexglyphs.tcl Fri Nov 27 23:54:35 2015
@@ -1,479 +0,0 @@
-# hexgliphs.tcl --
-
-# 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.
-
-#
-# The ASCII glyphs appearance was taken from Fossil
-# http://fossil-scm.org/ and reproduced by permission
-# of Richard Hipp
-#
-
-namespace eval ::HexGlyphs:: {
-
- variable HEXGLYPH
-
- array set HEXGLYPH {}
-
- proc glyph {g} {
- variable HEXGLYPH
-
- return $HEXGLYPH([string toupper $g])
- }
- namespace export glyph
-
- proc glyph_catalog {} {
- variable HEXGLYPH
-
- return [array names HEXGLYPH]
-
- }
- namespace export glyph_catalog
-
- proc build_hex {hs} {
- variable HEXGLYPH
-
- set glyphs_avail [array names HEXGLYPH]
-
- set hs [string toupper $hs]
- for {set i 0} {$i < [string length $hs]} {incr i} {
-
- set c [string index $hs $i]
-
- #if {![string is xdigit $c]}
- if {[lsearch $glyphs_avail $c] < 0} {
- return -code error -errocode invalid_char "Invalid non hexadecimal or non space character"
- }
-
- set lines [split $HEXGLYPH($c) "\n"]
- set lines [lrange $lines 1 end-1]
-
- set l 0
- foreach gliphline $lines {
- append hexline($l) $gliphline
- incr l
- }
-
- }
-
- return [list $hexline(0) \
- $hexline(1) \
- $hexline(2) \
- $hexline(3) \
- $hexline(4) \
- $hexline(5)]
-
- }
-
- proc toGlyphs {hexstring} {
-
- set hexstring_l [split $hexstring " \t"]
- foreach s $hexstring_l {
-
- set s [string trim $s]
-
- set string_l [[namespace current]::build_hex $s]
- for {set i 0} {$i < 6} {incr i} {
- lappend bigstring($i) [lindex $string_l $i]
- }
-
- }
-
- return [join [list [join $bigstring(0) " "] \
- [join $bigstring(1) " "] \
- [join $bigstring(2) " "] \
- [join $bigstring(3) " "] \
- [join $bigstring(4) " "] \
- [join $bigstring(5) " "]] "\n"]
- }
- namespace export toGlyphs
-
- namespace ensemble create
-}
-
-set ::HexGlyphs::HEXGLYPH(A) {
-
- /\
- / \
- / /\ \
- / ____ \
-/_/ \_\
-}
-
-set ::HexGlyphs::HEXGLYPH(B) {
- ____
-| _ \
-| |_) |
-| _ <
-| |_) |
-|____/
-}
-
-set ::HexGlyphs::HEXGLYPH(C) {
- _____
- / ____|
-| |
-| |
-| |____
- \_____|
-}
-
-set ::HexGlyphs::HEXGLYPH(D) {
- _____
-| __ \
-| | | |
-| | | |
-| |__| |
-|_____/
-}
-
-set ::HexGlyphs::HEXGLYPH(E) {
- ______
-| ____|
-| |__
-| __|
-| |____
-|______|
-}
-
-set ::HexGlyphs::HEXGLYPH(F) {
- ______
-| ____|
-| |__
-| __|
-| |
-|_|
-}
-
-set ::HexGlyphs::HEXGLYPH(G) {
- _____
- / ____|
-| | __
-| | |_ \
-| |___| |
- \_____/
-}
-
-set ::HexGlyphs::HEXGLYPH(H) {
- _ _
-| | | |
-| |_| |
-| _ |
-| | | |
-|_| |_|
-}
-
-set ::HexGlyphs::HEXGLYPH(I) {
- ___
-| |
- | |
- | |
- | |
-|___|
-}
-
-set ::HexGlyphs::HEXGLYPH(J) {
- ___
- | |
- | |
- _ | |
-| || |
-\____/
-}
-
-set ::HexGlyphs::HEXGLYPH(K) {
- _ _
-| | / |
-| |/ /
-| <
-| |\ \
-|_| \_\
-}
-
-set ::HexGlyphs::HEXGLYPH(L) {
- _
-| |
-| |
-| |
-| |___
-|_____|
-}
-
-set ::HexGlyphs::HEXGLYPH(M) {
- _ _
-| \ / |
-| \/ |
-| | | |
-| | | |
-|_| |_|
-}
-
-set ::HexGlyphs::HEXGLYPH(N) {
- _ _
-| \ | |
-| \ | |
-| \ \| |
-| |\ |
-|_| \__|
-}
-
-set ::HexGlyphs::HEXGLYPH(O) {
- _____
-| _ |
-| | | |
-| | | |
-| |_| |
-|_____|
-}
-
-set ::HexGlyphs::HEXGLYPH(P) {
- ____
-| _ \
-| |_| |
-| __/
-| |
-|_|
-}
-
-set ::HexGlyphs::HEXGLYPH(Q) {
- _____
-| _ |
-| | | |
-| |_| |
-|___\\|
- \\
-}
-
-set ::HexGlyphs::HEXGLYPH(R) {
- ____
-| _ \
-| |_| |
-| /
-| |\ \
-|_| \_\
-}
-
-set ::HexGlyphs::HEXGLYPH(S) {
- ____
-/ __|
-| |__
-\__ \
- __| |
-|____/
-}
-
-set ::HexGlyphs::HEXGLYPH(T) {
- _____
-|_ _|
- | |
- | |
- | |
- |_|
-}
-
-set ::HexGlyphs::HEXGLYPH(U) {
- _ _
-| | | |
-| | | |
-| | | |
-| |_| |
- \___/
-}
-
-set ::HexGlyphs::HEXGLYPH(V) {
- __ __
- \ \ / /
- \ \ / /
- \ v /
- \ /
- v
-}
-
-set ::HexGlyphs::HEXGLYPH(W) {
- __ __
- \ \ / /
- \ \/\/ /
- \ /
- \__/
-
-}
-
-set ::HexGlyphs::HEXGLYPH(X) {
- __ __
- \ \/ /
- \ /
- / \
- / /\ \
-/_/ \_\
-}
-
-set ::HexGlyphs::HEXGLYPH(Y) {
- __ __
- \ \ / /
- \ \/ /
- \ /
- / /
- /_/
-}
-
-set ::HexGlyphs::HEXGLYPH(Z) {
- ______
- |____ |
- / /
- / /
- / /___
- /______|
-}
-
-
-set ::HexGlyphs::HEXGLYPH(0) {
- ___
- / _ \
-| | | |
-| | | |
-| |_| |
- \___/
-}
-
-set ::HexGlyphs::HEXGLYPH(1) {
- __
-/_ |
- | |
- | |
- | |
- |_|
-}
-
-set ::HexGlyphs::HEXGLYPH(2) {
- ___
-|__ \
- ) |
- / /
- / /_
-|____|
-}
-
-set ::HexGlyphs::HEXGLYPH(3) {
- ____
-|___ \
- __) |
- |__ <
- ___) |
-|____/
-}
-
-set ::HexGlyphs::HEXGLYPH(4) {
- _ _
-| || |
-| || |_
-|__ _|
- | |
- |_|
-}
-
-set ::HexGlyphs::HEXGLYPH(5) {
- _____
-| ____|
-| |__
-|___ \
- ___) |
-|____/
-}
-
-set ::HexGlyphs::HEXGLYPH(6) {
- __
- / /
- / /_
-| '_ \
-| (_) |
- \___/
-}
-
-set ::HexGlyphs::HEXGLYPH(7) {
- ______
-|____ |
- / /
- / /
- / /
- /_/
-}
-set ::HexGlyphs::HEXGLYPH(8) {
- ___
- / _ \
-| (_) |
- > _ <
-| (_) |
- \___/
-}
-
-set ::HexGlyphs::HEXGLYPH(9) {
- ___
- / _ \
-| (_) |
- \__, |
- / /
- /_/
-}
-
-set ::HexGlyphs::HEXGLYPH(-) {
-
-
- ____
-|____|
-
-
-}
-
-set ::HexGlyphs::HEXGLYPH(_) {
-
-
-
-
- ______
-|______|
-}
-
-set ::HexGlyphs::HEXGLYPH(:) {
-
- _
- |_|
- _
- |_|
-
-}
-
-set ::HexGlyphs::HEXGLYPH(.) {
-
-
-
- _
- |_|
-
-}
-
-set ::HexGlyphs::HEXGLYPH(/) {
- __
- / /
- / /
- / /
- / /
- /_/
-}
-
-package provide HexGlyphs 0.1
-
-
Modified: tcl/rivet/branches/2.2/rivet/rivet-tcl/catch.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/rivet/rivet-tcl/catch.tcl?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/rivet/rivet-tcl/catch.tcl (original)
+++ tcl/rivet/branches/2.2/rivet/rivet-tcl/catch.tcl Fri Nov 27 23:54:35 2015
@@ -1,44 +0,0 @@
-# -- catch.tcl
-#
-# Wrapper of the core [::catch] command that checks whether
-# an error condition is actually raised by [::rivet::abort_page]
-# or [::rivet::exit]. In case the error is thrown again to allow
-# the interpreter to interrupt and pass execution to AbortScript
-#
-# $Id$
-#
-
-namespace eval ::rivet {
-
- proc catch {script args} {
-
- set catch_cmd [list ::catch $script]
- if {[llength $args] >= 1} {
- upvar [lindex $args 0] errvar
-
- lappend catch_cmd errvar
- }
- if {[llength $args] == 2} {
- upvar [lindex $args 1] catchopt
-
- lappend catch_cmd catchopt
- }
-
- set catch_ret [eval $catch_cmd]
-
- if {$catch_ret && [::rivet::abort_page -aborting]} {
-
- return -code error -errorcode ABORTPAGE 1
-
- } elseif {$catch_ret && [::rivet::abort_page -exiting]} {
-
- return -code error -errorcode EXITPAGE 1
-
- } else {
-
- return $catch_ret
-
- }
-
- }
-}
Modified: tcl/rivet/branches/2.2/rivet/rivet-tcl/tclIndex
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/rivet/rivet-tcl/tclIndex?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/rivet/rivet-tcl/tclIndex (original)
+++ tcl/rivet/branches/2.2/rivet/rivet-tcl/tclIndex Fri Nov 27 23:54:35 2015
@@ -28,4 +28,3 @@ set auto_index(::rivet::load_cookies) [l
set auto_index(::rivet::http_accept) [list source [file join $dir http_accept.tcl]]
set auto_index(::rivet::xml) [list source [file join $dir xml.tcl]]
set auto_index(::rivet::redirect) [list source [file join $dir redirect.tcl]]
-set auto_index(::rivet::catch) [list source [file join $dir catch.tcl]]
Modified: tcl/rivet/branches/2.2/src/apache-2/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/src/apache-2/mod_rivet.c?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/src/apache-2/mod_rivet.c (original)
+++ tcl/rivet/branches/2.2/src/apache-2/mod_rivet.c Fri Nov 27 23:54:35 2015
@@ -392,44 +392,6 @@ Rivet_ExecuteErrorHandler (Tcl_Interp* i
return result;
}
-/*
- * -- Rivet_RunAbortScript
- *
- *
- */
-
-static int
-Rivet_RunAbortScript (Tcl_Interp* interp,rivet_server_conf* conf,rivet_interp_globals* globals)
-{
- int retcode = TCL_OK;
-
- if (conf->rivet_abort_script)
- {
-
- /* Ideally an AbortScript should be fail safe, but in case
- * it fails we give a chance to the subsequent ErrorScript
- * to catch this error.
- */
-
- retcode = Tcl_EvalObjEx(interp,conf->rivet_abort_script,0);
- if (retcode == TCL_ERROR)
- {
- /* This is not elegant, but we want to avoid to print
- * this error message if an ErrorScript will handle this error.
- * Thus we print the usual error message only if we are running the
- * default error handler
- */
-
- if (conf->rivet_error_script == NULL)
- {
- Rivet_PrintErrorMessage(interp,"<b>Rivet AbortScript failed</b>");
- }
- Rivet_ExecuteErrorHandler(interp,conf->rivet_abort_script,globals);
- }
-
- }
- return retcode;
-}
/* -- Rivet_ExecuteAndCheck
*
@@ -468,18 +430,21 @@ Rivet_ExecuteAndCheck(Tcl_Interp *interp
Tcl_Preserve (interp);
result = Tcl_EvalObjEx(interp, tcl_script_obj, 0);
- if (result == TCL_ERROR)
- {
+ if (result == TCL_ERROR) {
+
Tcl_Obj* errorCodeListObj;
Tcl_Obj* errorCodeElementObj;
+ char* errorCodeSubString;
/* There was an error, see if it's from Rivet and it was caused
* by abort_page.
*/
+
errorCodeListObj = Tcl_GetVar2Ex (interp, "errorCode", (char *)NULL, TCL_GLOBAL_ONLY);
/* errorCode is guaranteed to be set to NONE, but let's make sure
- * anyway rather than causing a SIGSEGV */
+ * anyway rather than causing a SIGSEGV
+ */
ap_assert (errorCodeListObj != (Tcl_Obj *)NULL);
/* dig the first element out of the errorCode list and see if it
@@ -491,15 +456,50 @@ Rivet_ExecuteAndCheck(Tcl_Interp *interp
* if so, don't treat it as an error, i.e. don't execute the
* installed error handler or the default one, just check if
* a rivet_abort_script is defined, otherwise the page emits
- * as normal */
- if (globals->page_aborting)
- {
- Rivet_RunAbortScript(interp,conf,globals);
+ * as normal
+ */
+ if (strcmp (Tcl_GetString (errorCodeElementObj), "RIVET") == 0) {
+
+ /* dig the second element out of the errorCode list, make sure
+ * it succeeds -- it should always
+ */
+ ap_assert (Tcl_ListObjIndex (interp, errorCodeListObj, 1, &errorCodeElementObj) == TCL_OK);
+
+ errorCodeSubString = Tcl_GetString (errorCodeElementObj);
+ if (strcmp (errorCodeSubString, ABORTPAGE_CODE) == 0)
+ {
+ if (conf->rivet_abort_script)
+ {
+
+ /* Ideally an AbortScript should be fail safe, but in case
+ * it fails we give a chance to the subsequent ErrorScript
+ * to catch this error.
+ */
+
+ if (Tcl_EvalObjEx(interp,conf->rivet_abort_script,0) == TCL_ERROR)
+ {
+
+ /* This is not elegant, but we want to avoid to print
+ * the default AbortScript error message if a custom ErrorScript
+ * will handle this error and in case print its own error message.
+ */
+
+ if (conf->rivet_error_script == NULL)
+ {
+ Rivet_PrintErrorMessage(interp,"<b>Rivet AbortScript failed</b>");
+ }
+ Rivet_ExecuteErrorHandler(interp,conf->rivet_abort_script,globals);
+
+ }
+ }
+ }
}
- else
+ else if (!globals->page_aborting)
{
/* Invoke Rivet error handler */
+
Rivet_ExecuteErrorHandler(interp,tcl_script_obj,globals);
+
}
}
@@ -954,6 +954,10 @@ Rivet_PerInterpInit(server_rec *s, rivet
/* Watch out! Calling Tcl_PkgRequire with a version number binds this module to
* the Rivet package revision number in rivet/init.tcl
+ *
+ * RIVET_TCL_PACKAGE_VERSION is defined by configure.ac as the combination
+ * "MAJOR_VERSION.MINOR_VERSION". We don't expect to change rivet/init.tcl
+ * across patchlevel releases
*/
if (Tcl_PkgRequire(interp, "Rivet", RIVET_TCL_PACKAGE_VERSION, 1) == NULL)
@@ -987,7 +991,7 @@ Rivet_InitHandler(apr_pool_t *pPool, apr
rivet_panic_pool = pPool;
rivet_panic_server_rec = s;
- rivet_module_globals = apr_pcalloc(pPool,sizeof(mod_rivet_globals));
+ rivet_module_globals = apr_palloc(pPool,sizeof(mod_rivet_globals));
rivet_module_globals->rsc_p = rsc;
#if RIVET_DISPLAY_VERSION
ap_add_version_component(pPool, RIVET_PACKAGE_NAME"/"RIVET_VERSION);
@@ -1485,14 +1489,9 @@ Rivet_SendContent(request_rec *r)
r->allowed |= (1 << M_POST);
r->allowed |= (1 << M_PUT);
r->allowed |= (1 << M_DELETE);
- if (r->method_number != M_GET &&
- r->method_number != M_POST &&
- r->method_number != M_PUT &&
- r->method_number != M_DELETE) {
-
+ if (r->method_number != M_GET && r->method_number != M_POST && r->method_number != M_PUT && r->method_number != M_DELETE) {
retval = DECLINED;
goto sendcleanup;
-
}
if (r->finfo.filetype == 0)
@@ -1651,13 +1650,6 @@ Rivet_SendContent(request_rec *r)
retval = OK;
sendcleanup:
- if (globals->exit_process)
- {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_EGENERAL, r,
- "process terminating with code %d",globals->exit_status);
- Tcl_Exit(globals->exit_status);
- }
-
/* Everything is done and we flush the rivet channel before resetting the status */
globals->req->content_sent = 0;
Modified: tcl/rivet/branches/2.2/src/apache-2/mod_rivet.h
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/src/apache-2/mod_rivet.h?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/src/apache-2/mod_rivet.h (original)
+++ tcl/rivet/branches/2.2/src/apache-2/mod_rivet.h Fri Nov 27 23:54:35 2015
@@ -1,22 +1,18 @@
/* mod_rivet.h -- The apache module itself, for Apache 2.x. */
-/*
- 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.
+/* Copyright 2000-2005 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.
*/
/* $Id$ */
@@ -115,8 +111,6 @@ typedef struct _rivet_interp_globals {
Tcl_Namespace *rivet_ns; /* Rivet commands namespace */
int page_aborting; /* set by abort_page. */
Tcl_Obj* abort_code; /* To be reset by Rivet_SendContent */
- int exit_process; /* signals a ::rivet::exit command was called */
- int exit_status; /* ::rivet::exit status code */
server_rec* srec; /* pointer to the current server rec obj */
} rivet_interp_globals;
@@ -158,7 +152,6 @@ Tcl_Obj* Rivet_CurrentServerRec ( Tcl_
/* error code set by command 'abort_page' */
#define ABORTPAGE_CODE "ABORTPAGE"
-#define EXITPAGE_CODE "EXITPAGE"
#endif /* MOD_RIVET_H */
Modified: tcl/rivet/branches/2.2/src/librivet/rivetCrypt.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/src/librivet/rivetCrypt.c?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/src/librivet/rivetCrypt.c (original)
+++ tcl/rivet/branches/2.2/src/librivet/rivetCrypt.c Fri Nov 27 23:54:35 2015
@@ -148,9 +148,9 @@ TCL_CMD_HEADER( Rivet_CryptCmd )
#endif /* ! crypt */
}
+
/*-----------------------------------------------------------------------------
* Rivet_initCrypt --
- *
* Initialize the encrypt, decrypt and crypt commands in an interpreter.
*
* These routines have been examined and are believed to be safe in a safe
@@ -160,28 +160,11 @@ TCL_CMD_HEADER( Rivet_CryptCmd )
* o interp - Interpreter to add commands to.
*-----------------------------------------------------------------------------
*/
-
-#if RIVET_NAMESPACE_EXPORT == 1
-extern Tcl_Namespace* Rivet_GetNamespace( Tcl_Interp* interp);
-#endif
-
int
Rivet_InitCrypt( Tcl_Interp *interp)
{
RIVET_OBJ_CMD("encrypt", Rivet_EncryptCmd);
RIVET_OBJ_CMD("decrypt", Rivet_DecryptCmd);
RIVET_OBJ_CMD("crypt", Rivet_CryptCmd);
-
-#if RIVET_NAMESPACE_EXPORT == 1
- {
- Tcl_Namespace* rivet_ns = Rivet_GetNamespace(interp);
-
- RIVET_EXPORT_CMD(interp,rivet_ns,"encrypt");
- RIVET_EXPORT_CMD(interp,rivet_ns,"decrypt");
- RIVET_EXPORT_CMD(interp,rivet_ns,"crypt");
-
- }
-#endif
-
return TCL_OK;
}
Modified: tcl/rivet/branches/2.2/src/librivet/rivetList.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/src/librivet/rivetList.c?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/src/librivet/rivetList.c (original)
+++ tcl/rivet/branches/2.2/src/librivet/rivetList.c Fri Nov 27 23:54:35 2015
@@ -522,9 +522,9 @@ TCL_CMD_HEADER( Rivet_LassignArrayObjCmd
return TCL_OK;
}
+
/*-----------------------------------------------------------------------------
* Rivet_initList --
- *
* Initialize the list commands in an interpreter.
*
* These routines have been examined and are believed to be safe in a safe
@@ -537,10 +537,6 @@ TCL_CMD_HEADER( Rivet_LassignArrayObjCmd
*-----------------------------------------------------------------------------
*/
-#if RIVET_NAMESPACE_EXPORT == 1
-extern Tcl_Namespace* Rivet_GetNamespace( Tcl_Interp* interp);
-#endif
-
int
Rivet_InitList( Tcl_Interp *interp)
{
@@ -548,14 +544,6 @@ Rivet_InitList( Tcl_Interp *interp)
RIVET_OBJ_CMD("comma_split",Rivet_CommaSplitObjCmd);
RIVET_OBJ_CMD("comma_join",Rivet_CommaJoinObjCmd);
RIVET_OBJ_CMD("lassign_array",Rivet_LassignArrayObjCmd);
-#if RIVET_NAMESPACE_EXPORT == 1
- {
- Tcl_Namespace* rivet_ns = Rivet_GetNamespace(interp);
- RIVET_EXPORT_CMD(interp,rivet_ns,"lremove");
- RIVET_EXPORT_CMD(interp,rivet_ns,"comma_split");
- RIVET_EXPORT_CMD(interp,rivet_ns,"comma_join");
- RIVET_EXPORT_CMD(interp,rivet_ns,"lassign_array");
- }
-#endif
+
return TCL_OK;
}
Modified: tcl/rivet/branches/2.2/src/librivet/rivetPkgInit.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/src/librivet/rivetPkgInit.c?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/src/librivet/rivetPkgInit.c (original)
+++ tcl/rivet/branches/2.2/src/librivet/rivetPkgInit.c Fri Nov 27 23:54:35 2015
@@ -49,7 +49,8 @@
#if RIVET_NAMESPACE_EXPORT == 1
-Tcl_Namespace* Rivet_GetNamespace( Tcl_Interp* interp)
+static Tcl_Namespace*
+Rivet_GetNamespace( Tcl_Interp* interp)
{
rivet_interp_globals *globals;
Tcl_Namespace *rivet_ns;
@@ -90,7 +91,7 @@ int
Rivetlib_Init( Tcl_Interp *interp )
{
#if RIVET_NAMESPACE_EXPORT == 1
- //Tcl_Namespace *rivet_ns;
+ Tcl_Namespace *rivet_ns;
#endif
#ifdef USE_TCL_STUBS
@@ -105,8 +106,8 @@ Rivetlib_Init( Tcl_Interp *interp )
Rivet_InitCrypt(interp);
Rivet_InitWWW (interp);
#if RIVET_NAMESPACE_EXPORT == 1
- //rivet_ns = Rivet_GetNamespace(interp);
- //Tcl_Export(interp,rivet_ns,"*",0);
+ rivet_ns = Rivet_GetNamespace(interp);
+ Tcl_Export(interp,rivet_ns,"*",0);
#endif
return Tcl_PkgProvide( interp, RIVETLIB_TCL_PACKAGE, RIVET_VERSION );
@@ -127,6 +128,10 @@ Rivetlib_Init( Tcl_Interp *interp )
int
Rivetlib_SafeInit( 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) {
#else
@@ -139,5 +144,9 @@ Rivetlib_SafeInit( Tcl_Interp *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 );
}
Modified: tcl/rivet/branches/2.2/src/librivet/rivetWWW.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/src/librivet/rivetWWW.c?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/src/librivet/rivetWWW.c (original)
+++ tcl/rivet/branches/2.2/src/librivet/rivetWWW.c Fri Nov 27 23:54:35 2015
@@ -350,9 +350,6 @@ TCL_CMD_HEADER( Rivet_EscapeShellCommand
* in safe interpreters, as they process strings only.
*-----------------------------------------------------------------------------
*/
-#if RIVET_NAMESPACE_EXPORT == 1
-extern Tcl_Namespace* Rivet_GetNamespace( Tcl_Interp* interp);
-#endif
int
Rivet_InitWWW( Tcl_Interp *interp)
@@ -361,16 +358,5 @@ Rivet_InitWWW( Tcl_Interp *interp)
RIVET_OBJ_CMD ("escape_string",Rivet_EscapeStringCmd);
RIVET_OBJ_CMD ("escape_sgml_chars",Rivet_EscapeSgmlCharsCmd);
RIVET_OBJ_CMD ("escape_shell_command",Rivet_EscapeShellCommandCmd);
-
-#if RIVET_NAMESPACE_EXPORT == 1
- {
- Tcl_Namespace* rivet_ns = Rivet_GetNamespace(interp);
-
- RIVET_EXPORT_CMD(interp,rivet_ns,"unescape_string");
- RIVET_EXPORT_CMD(interp,rivet_ns,"escape_string");
- RIVET_EXPORT_CMD(interp,rivet_ns,"escape_sgml_chars");
- RIVET_EXPORT_CMD(interp,rivet_ns,"escape_shell_command");
- }
-#endif
return TCL_OK;
}
Modified: tcl/rivet/branches/2.2/src/rivet.h
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/src/rivet.h?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/src/rivet.h (original)
+++ tcl/rivet/branches/2.2/src/rivet.h Fri Nov 27 23:54:35 2015
@@ -54,10 +54,6 @@ Tcl_CreateObjCommand( interp, /* Tcl int
NULL, /* Client Data */\
(Tcl_CmdDeleteProc *)NULL /* Tcl Delete Prov */);
-#define RIVET_EXPORT_CMD(interp,ns,cmdname) Tcl_Export(interp,ns,cmdname,0);
-
-//Tcl_ListObjAppendElement(interp,export_l,Tcl_NewStringObj(RIVET_NS "::" cmdname,-1));
-
/*
* Pointer in r is checked and in case Rivet_NoRequestRec is
* called returning TCL_ERROR. This macro is used (and often
Modified: tcl/rivet/branches/2.2/src/rivetcmds/rivetCore.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/src/rivetcmds/rivetCore.c?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/src/rivetcmds/rivetCore.c (original)
+++ tcl/rivet/branches/2.2/src/rivetcmds/rivetCore.c Fri Nov 27 23:54:35 2015
@@ -1,22 +1,20 @@
-/* rivetCore.c - Core commands which are compiled into mod_rivet itself. */
+/*
+ * rivetCore.c - Core commands which are compiled into mod_rivet itself.
+ */
+
+/* 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
-/*
- 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.
+ 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.
*/
/* $Id$ */
@@ -58,6 +56,8 @@ extern char* TclWeb_GetRawPost (TclWebRe
#define POOL (globals->r->pool)
+
+
/*
* -- Rivet_NoRequestRec
*
@@ -1191,12 +1191,6 @@ TCL_CMD_HEADER( Rivet_AbortPageCmd )
return TCL_OK;
}
- if (strcmp(cmd_arg,"-exiting") == 0)
- {
- Tcl_SetObjResult (interp,Tcl_NewBooleanObj(globals->exit_process));
- return TCL_OK;
- }
-
/*
* we assume abort_code to be null, as abort_page shouldn't run twice while
* processing the same request
@@ -1220,7 +1214,7 @@ TCL_CMD_HEADER( Rivet_AbortPageCmd )
return TCL_OK;
}
- /* this is the first (and supposedly unique) abort_page call in a request */
+ /* this is the first (and supposedly unique) abort_page call during this request */
globals->page_aborting = 1;
@@ -1555,74 +1549,6 @@ TCL_CMD_HEADER( Rivet_LogErrorCmd )
return TCL_OK;
}
-/*
- *-----------------------------------------------------------------------------
- *
- * Rivet_ExitCmd --
- *
- * The exit_process flag is set and the procedure is interrupted
- * setting the abort_page flag to let this condition be handled
- * by an AbortScript before the child process exits
- *
- * Result:
- *
- * TCL_ERROR
- *
- * Side Effects:
- *
- * - non threaded MPMs: the child process exits for good
- * - threaded MPMs: the logical variable controlling a bridge thread
- * is set to zero and the request processing is interrupted
- *
- *-----------------------------------------------------------------------------
- */
-TCL_CMD_HEADER( Rivet_ExitCmd )
-{
- static char *errorMessage = "Page generation terminated by ::rivet::exit";
- int value;
- rivet_interp_globals* globals = Tcl_GetAssocData( interp, "rivet", NULL );
-
- if ((objc != 1) && (objc != 2)) {
- Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?");
- return TCL_ERROR;
- }
-
- if (objc == 1) {
- value = 0;
- } else if (Tcl_GetIntFromObj(interp, objv[1], &value) != TCL_OK) {
- return TCL_ERROR;
- }
-
- globals->page_aborting = 1;
- globals->abort_code = Tcl_NewDictObj();
-
- /* The private->abort_code ref count is decremented before
- * request processing terminates*/
-
- Tcl_IncrRefCount(globals->abort_code);
-
- /*
- * mod_rivet traps call to exit and offers a chance to handle them
- * in the way we handle ::rivet::abort_page calls
- */
-
- Tcl_DictObjPut(interp,globals->abort_code,
- Tcl_NewStringObj("error_code",-1),
- Tcl_NewStringObj("exit",-1));
-
- Tcl_DictObjPut(interp,globals->abort_code,
- Tcl_NewStringObj("return_code",-1),
- Tcl_NewIntObj(value));
-
- globals->exit_process = 1;
- globals->exit_status = value;
-
- Tcl_AddErrorInfo (interp, errorMessage);
- Tcl_SetErrorCode (interp, "RIVET", EXITPAGE_CODE, errorMessage, (char *)NULL);
- return TCL_ERROR;
-}
-
-
#define TESTPANIC 0
#ifdef TESTPANIC
@@ -1683,6 +1609,14 @@ TestpanicCmd(dummy, interp, argc, argv)
int
Rivet_InitCore( Tcl_Interp *interp )
{
+#if RIVET_NAMESPACE_EXPORT == 1
+ rivet_interp_globals *globals = NULL;
+ Tcl_Namespace *rivet_ns;
+
+ globals = Tcl_GetAssocData(interp, "rivet", NULL);
+ rivet_ns = globals->rivet_ns;
+#endif
+
RIVET_OBJ_CMD ("makeurl",Rivet_MakeURL);
RIVET_OBJ_CMD ("headers",Rivet_Headers);
RIVET_OBJ_CMD ("load_env",Rivet_LoadEnv);
@@ -1702,41 +1636,13 @@ Rivet_InitCore( Tcl_Interp *interp )
RIVET_OBJ_CMD ("env",Rivet_EnvCmd);
RIVET_OBJ_CMD ("apache_log_error",Rivet_LogErrorCmd);
RIVET_OBJ_CMD ("inspect",Rivet_InspectCmd);
- RIVET_OBJ_CMD ("exit",Rivet_ExitCmd);
#ifdef TESTPANIC
RIVET_OBJ_CMD ("testpanic",TestpanicCmd);
#endif
#if RIVET_NAMESPACE_EXPORT == 1
- {
- rivet_interp_globals *globals = NULL;
- Tcl_Namespace* rivet_ns;
-
- globals = Tcl_GetAssocData(interp, "rivet", NULL);
- rivet_ns = globals->rivet_ns;
-
- RIVET_EXPORT_CMD(interp,rivet_ns,"makeurl");
- RIVET_EXPORT_CMD(interp,rivet_ns,"headers");
- RIVET_EXPORT_CMD(interp,rivet_ns,"load_env");
- RIVET_EXPORT_CMD(interp,rivet_ns,"load_headers");
- RIVET_EXPORT_CMD(interp,rivet_ns,"var");
- RIVET_EXPORT_CMD(interp,rivet_ns,"abort_page");
- RIVET_EXPORT_CMD(interp,rivet_ns,"abort_code");
- RIVET_EXPORT_CMD(interp,rivet_ns,"virtual_filename");
- RIVET_EXPORT_CMD(interp,rivet_ns,"apache_table");
- RIVET_EXPORT_CMD(interp,rivet_ns,"var_qs");
- RIVET_EXPORT_CMD(interp,rivet_ns,"var_post");
- RIVET_EXPORT_CMD(interp,rivet_ns,"raw_post");
- RIVET_EXPORT_CMD(interp,rivet_ns,"upload");
- RIVET_EXPORT_CMD(interp,rivet_ns,"include");
- RIVET_EXPORT_CMD(interp,rivet_ns,"parse");
- RIVET_EXPORT_CMD(interp,rivet_ns,"no_body");
- RIVET_EXPORT_CMD(interp,rivet_ns,"env");
- RIVET_EXPORT_CMD(interp,rivet_ns,"apache_log_error");
- RIVET_EXPORT_CMD(interp,rivet_ns,"inspect");
- }
- // ::rivet::exit is not exported
+ Tcl_Export(interp,rivet_ns,"*",0);
#endif
// return Tcl_PkgProvide( interp,RIVET_TCL_PACKAGE,"1.2");
Modified: tcl/rivet/branches/2.2/tests/bailout.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/tests/bailout.test?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/tests/bailout.test (original)
+++ tcl/rivet/branches/2.2/tests/bailout.test Fri Nov 27 23:54:35 2015
@@ -1,45 +0,0 @@
-# redirect.test -- test redirect command.
-#
-# redirect must trigger an AbortScript and have
-# predictable data stored in the abort code
-
-# $Id: $
-
-::tcltest::test bailout-1.1 {redirect command} {
- apachetest::start {} {
- RivetServerConf AbortScript "::rivet::apache_log_error err \\\"catching redirect\\\""
- RivetServerConf AbortScript "set tmpfp \[open redirect_code.txt w+\]"
- RivetServerConf AbortScript "puts \$tmpfp \[::rivet::abort_code\]"
- RivetServerConf AbortScript "close \$tmpfp"
- } {
- set url "${urlbase}redirect.rvt?base=$urlbase"
- #puts $url
- catch {set page1 [::http::geturl $url]}
- puts "verifying abort code"
- set rdfp [open redirect_code.txt r]
- set redirect_code [dict create {*}[read $rdfp]]
- set r1 [dict exists $redirect_code location]
- set r2 [dict exists $redirect_code error_code]
- }
- list $r1 $r2
-} {1 1}
-
-
-::tcltest::test bailout-1.2 {exit command} {
- apachetest::start {} {
- RivetServerConf AbortScript "::rivet::apache_log_error err \\\"catching exit\\\""
- RivetServerConf AbortScript "set abcode \[::rivet::abort_code\]"
- RivetServerConf AbortScript "puts -nonewline \[::rivet::abort_page -exiting\]"
- RivetServerConf AbortScript "puts -nonewline \\\" \[dict get \$abcode error_code\] \[dict get \$abcode return_code\]\\\""
- } {
- puts "test exit command"
- set url "${urlbase}exit.tcl"
- set page [::http::geturl $url]
- set r [::http::data $page]
- ::http::cleanup $page
- }
- set r
-} {1 exit 100}
-
-
-
Modified: tcl/rivet/branches/2.2/tests/exit.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/tests/exit.tcl?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/tests/exit.tcl (original)
+++ tcl/rivet/branches/2.2/tests/exit.tcl Fri Nov 27 23:54:35 2015
@@ -1 +0,0 @@
-exit 100
Modified: tcl/rivet/branches/2.2/tests/redirect.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/tests/redirect.test?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/tests/redirect.test (original)
+++ tcl/rivet/branches/2.2/tests/redirect.test Fri Nov 27 23:54:35 2015
@@ -5,12 +5,13 @@
# $Id: $
-::tcltest::test bailout-1.1 {redirect command} {
+::tcltest::test redirect-1.1 {redirect command} {
apachetest::start {} {
RivetServerConf AbortScript "::rivet::apache_log_error err \\\"catching redirect\\\""
RivetServerConf AbortScript "set tmpfp \[open redirect_code.txt w+\]"
RivetServerConf AbortScript "puts \$tmpfp \[::rivet::abort_code\]"
RivetServerConf AbortScript "close \$tmpfp"
+ RivetServerConf AbortScript "touch /tmp/aaaaaa"
} {
set url "${urlbase}redirect.rvt?base=$urlbase"
#puts $url
Modified: tcl/rivet/branches/2.2/tests/rivet.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/tests/rivet.test?rev=1716933&r1=1716932&r2=1716933&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/tests/rivet.test (original)
+++ tcl/rivet/branches/2.2/tests/rivet.test Fri Nov 27 23:54:35 2015
@@ -59,19 +59,17 @@ if { $testgroup2 } {
# These tests start the server on their own, or don't need the server
# at all.
-set TestList {
+if { $testgroup3 } {
+ foreach Test {
failtest.test
broken.test
config.test
parsepackage.test
virtualhost.test
inspect.test
- bailout.test
+ redirect.test
channel.test
- }
-
-if { $testgroup3 } {
- foreach Test $TestList {
+ } {
puts "Running $Test"
source $Test
}
---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org