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 2017/07/24 11:47:05 UTC
svn commit: r1802791 - in /tcl/rivet/trunk: ./ doc/ rivet/
rivet/packages/calendar/ rivet/packages/formbroker/ src/mod_rivet_ng/
Author: mxmanghi
Date: Mon Jul 24 11:47:04 2017
New Revision: 1802791
URL: http://svn.apache.org/viewvc?rev=1802791&view=rev
Log:
* xml/rivet.xml.in: reflects rivet.xml having been moved to doc/xml
* rivet/default_request_handler.tcl: code of the default
request handler read by mod_rivet
* Makefile.am: now installing also rivet/default_request_handler.tcl
* src/mod_rivet_ng/mod_rivet.c: add function for creation of
the module_globals strucuture. This structure is not assumed anymore
to be inherited through a fork operation and it's now in case
re-created at child process initialization
* src/mod_rivet_ng/rivet_lazy_mpm.c: removing
reference to unused global variable
* src/mod_rivet_ng/mod_rivet_common.c: Rivet_RunningScripts
handling default request procedure specified in the configuration
Modified:
tcl/rivet/trunk/ChangeLog
tcl/rivet/trunk/Makefile.am
tcl/rivet/trunk/Makefile.in
tcl/rivet/trunk/doc/rivet.xml
tcl/rivet/trunk/doc/rivet.xml.in
tcl/rivet/trunk/rivet/default_request_handler.tcl
tcl/rivet/trunk/rivet/init.tcl
tcl/rivet/trunk/rivet/init.tcl.in
tcl/rivet/trunk/rivet/packages/calendar/calendar.tcl
tcl/rivet/trunk/rivet/packages/formbroker/formbroker.tcl
tcl/rivet/trunk/src/mod_rivet_ng/apache_config.c
tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet.c
tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet.h
tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c
tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.h
tcl/rivet/trunk/src/mod_rivet_ng/rivet_lazy_mpm.c
tcl/rivet/trunk/src/mod_rivet_ng/rivet_prefork_mpm.c
Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Mon Jul 24 11:47:04 2017
@@ -1,3 +1,21 @@
+2017-07-24 Massimo Manghi <mx...@apache.org>
+ * xml/rivet.xml.in: reflects rivet.xml having been moved to doc/xml
+ * rivet/default_request_handler.tcl: code of the default
+ request handler read by mod_rivet
+ * Makefile.am: now installing also rivet/default_request_handler.tcl
+ * src/mod_rivet_ng/mod_rivet.c: add function for creation of
+ the module_globals strucuture. This structure is not assumed anymore
+ to be inherited through a fork operation and it's now in case
+ re-created at child process initialization
+ * src/mod_rivet_ng/rivet_lazy_mpm.c: removing
+ reference to unused global variable
+ * src/mod_rivet_ng/mod_rivet_common.c: Rivet_RunningScripts
+ handling default request procedure specified in the configuration
+
+2017-07-20 Massimo Manghi <mx...@apache.org>
+ * rivet/packages/formbroker/formbroker.tcl: now using Tcl
+ [string is boolean ...]
+
2017-07-19 Massimo Manghi <mx...@apache.org>
* doc/xml/internals.xml: moving the internals chapter
to its final directory
Modified: tcl/rivet/trunk/Makefile.am
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/Makefile.am?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/Makefile.am (original)
+++ tcl/rivet/trunk/Makefile.am Mon Jul 24 11:47:04 2017
@@ -29,6 +29,7 @@ install-binaries:
$(mkinstalldirs) $(RIVETLIB_DESTDIR)
$(mkinstalldirs) $(RIVETLIB_DESTDIR)/rivet-tcl
$(install_sh) -C $(builddir)/rivet/init.tcl $(RIVETLIB_DESTDIR)
+ $(install_sh) -C $(builddir)/rivet/default_request_handler.tcl $(RIVETLIB_DESTDIR)
$(install_sh) -C -m 644 $(shell /bin/ls $(srcdir)/rivet/rivet-tcl/*) $(RIVETLIB_DESTDIR)/rivet-tcl
#cp -rv $(srcdir)/rivet/packages $(RIVETLIB_DESTDIR)/
Modified: tcl/rivet/trunk/Makefile.in
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/Makefile.in?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/Makefile.in (original)
+++ tcl/rivet/trunk/Makefile.in Mon Jul 24 11:47:04 2017
@@ -930,6 +930,7 @@ install-binaries:
$(mkinstalldirs) $(RIVETLIB_DESTDIR)
$(mkinstalldirs) $(RIVETLIB_DESTDIR)/rivet-tcl
$(install_sh) -C $(builddir)/rivet/init.tcl $(RIVETLIB_DESTDIR)
+ $(install_sh) -C $(builddir)/rivet/default_request_handler.tcl $(RIVETLIB_DESTDIR)
$(install_sh) -C -m 644 $(shell /bin/ls $(srcdir)/rivet/rivet-tcl/*) $(RIVETLIB_DESTDIR)/rivet-tcl
#cp -rv $(srcdir)/rivet/packages $(RIVETLIB_DESTDIR)/
Modified: tcl/rivet/trunk/doc/rivet.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/rivet.xml?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/rivet.xml (original)
+++ tcl/rivet/trunk/doc/rivet.xml Mon Jul 24 11:47:04 2017
@@ -13,7 +13,7 @@
<!ENTITY rivet_web_service.tcl SYSTEM "examples-sgml/rivet_web_service.tcl" >
<!ENTITY intro.xml SYSTEM "xml/intro.xml" >
<!ENTITY install.xml SYSTEM "xml/installation.xml" >
- <!ENTITY directives.xml SYSTEM "xml/directives.xml" >
+ <!ENTITY directives.xml SYSTEM "xml/directives.xml" >
<!ENTITY commands.xml SYSTEM "xml/commands.xml" >
<!ENTITY examples.xml SYSTEM "xml-2/examples.xml" >
<!ENTITY packages.xml SYSTEM "xml-2/packages.xml" >
@@ -31,15 +31,15 @@
<!ENTITY asciiglyphs.xml SYSTEM "xml-2/asciiglyphs.xml" >
<!ENTITY lazybridge.xml SYSTEM "xml/lazybridge.xml" >
<!ENTITY formbroker.xml SYSTEM "xml/formbroker.xml" >
- <!ENTITY version "3.0" >
- <!ENTITY fullversion "3.0.0" >
- <!ENTITY version2-series "2.0,2.1,2.2,2.3" >
- <!ENTITY version2-generic "2.x" >
- <!ENTITY version30 "3.0" >
+ <!ENTITY version "3.0" >
+ <!ENTITY fullversion "3.0.0" >
+ <!ENTITY version2-series "2.0,2.1,2.2,2.3" >
+ <!ENTITY version2-generic "2.x" >
+ <!ENTITY version30 "3.0" >
<!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-mpm "https://httpd.apache.org/docs/2.4/mpm.html" >
]>
<!--
Modified: tcl/rivet/trunk/doc/rivet.xml.in
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/rivet.xml.in?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/rivet.xml.in (original)
+++ tcl/rivet/trunk/doc/rivet.xml.in Mon Jul 24 11:47:04 2017
@@ -2,18 +2,18 @@
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/committees/docbook/xml/4.1.2/docbookx.dtd" [
- <!ENTITY hello.rvt SYSTEM "examples-sgml/hello.rvt" >
- <!ENTITY hello1.rvt SYSTEM "examples-sgml/hello1.rvt" >
+ <!ENTITY hello.rvt SYSTEM "examples-sgml/hello.rvt" >
+ <!ENTITY hello1.rvt SYSTEM "examples-sgml/hello1.rvt" >
<!ENTITY color-table.tcl SYSTEM "examples-sgml/color-table.tcl" >
- <!ENTITY vars.html SYSTEM "examples-sgml/vars.html" >
- <!ENTITY vars.rvt SYSTEM "examples-sgml/vars.rvt" >
- <!ENTITY upload.html SYSTEM "examples-sgml/upload.html" >
- <!ENTITY upload.rvt SYSTEM "examples-sgml/upload.rvt" >
- <!ENTITY download.tcl SYSTEM "examples-sgml/download.tcl" >
+ <!ENTITY vars.html SYSTEM "examples-sgml/vars.html" >
+ <!ENTITY vars.rvt SYSTEM "examples-sgml/vars.rvt" >
+ <!ENTITY upload.html SYSTEM "examples-sgml/upload.html" >
+ <!ENTITY upload.rvt SYSTEM "examples-sgml/upload.rvt" >
+ <!ENTITY download.tcl SYSTEM "examples-sgml/download.tcl" >
<!ENTITY rivet_web_service.tcl SYSTEM "examples-sgml/rivet_web_service.tcl" >
- <!ENTITY intro.xml SYSTEM "xml/intro.xml" >
- <!ENTITY install.xml SYSTEM "xml/installation.xml" >
- <!ENTITY directives.xml SYSTEM "xml/directives.xml" >
+ <!ENTITY intro.xml SYSTEM "xml/intro.xml" >
+ <!ENTITY install.xml SYSTEM "xml/installation.xml" >
+ <!ENTITY directives.xml SYSTEM "xml/directives.xml" >
<!ENTITY commands.xml SYSTEM "xml/commands.xml" >
<!ENTITY examples.xml SYSTEM "xml-2/examples.xml" >
<!ENTITY packages.xml SYSTEM "xml-2/packages.xml" >
@@ -23,7 +23,7 @@
<!ENTITY form.xml SYSTEM "xml-2/form.xml" >
<!ENTITY calendar.xml SYSTEM "xml-2/calendar.xml" >
<!ENTITY help.xml SYSTEM "xml-2/help.xml" >
- <!ENTITY internals.xml SYSTEM "xml-2/internals.xml" >
+ <!ENTITY internals.xml SYSTEM "xml/internals.xml" >
<!ENTITY upgrade.xml SYSTEM "xml-2/upgrade.xml" >
<!ENTITY request.xml SYSTEM "xml-2/request.xml" >
<!ENTITY processing.xml SYSTEM "xml/processing.xml" >
@@ -31,15 +31,15 @@
<!ENTITY asciiglyphs.xml SYSTEM "xml-2/asciiglyphs.xml" >
<!ENTITY lazybridge.xml SYSTEM "xml/lazybridge.xml" >
<!ENTITY formbroker.xml SYSTEM "xml/formbroker.xml" >
- <!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 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 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-mpm "https://httpd.apache.org/docs/2.4/mpm.html" >
]>
<!--
@@ -138,6 +138,6 @@
&lazybridge.xml;
<!-- Upgrade -->
- &upgrade.xml;
+ <!-- &upgrade.xml; -->
</article>
Modified: tcl/rivet/trunk/rivet/default_request_handler.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/default_request_handler.tcl?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/default_request_handler.tcl (original)
+++ tcl/rivet/trunk/rivet/default_request_handler.tcl Mon Jul 24 11:47:04 2017
@@ -1,12 +1,24 @@
# -- request_handler.tcl
#
-# code for the default handler of HTTP requests
+# Copyright 2002-2017 The Apache Rivet Team
#
+# 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.
#
+# code of the default handler of HTTP requests
::try {
- uplevel #0 ::Rivet::initialize_request
+ ::Rivet::initialize_request
} on error {err} {
::rivet::apache_log_error crit \
"Rivet request initialization failed: $::errorInfo"
@@ -17,7 +29,7 @@
set script [::rivet::inspect BeforeScript]
if {$script ne ""} {
set ::Rivet::script $script
- uplevel #0 $script
+ eval $script
}
set script [::rivet::url_script]
@@ -29,7 +41,7 @@
set script [::rivet::inspect AfterScript]
if {$script ne ""} {
set ::Rivet::script $script
- uplevel #0 $script
+ eval $script
}
} trap {RIVET ABORTPAGE} {err opts} {
@@ -41,5 +53,5 @@
} finally {
::Rivet::finish_request $script "" "" AfterEveryScript
}
-
-
+
+# default_request_handler.tcl ---
Modified: tcl/rivet/trunk/rivet/init.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/init.tcl?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/init.tcl (original)
+++ tcl/rivet/trunk/rivet/init.tcl Mon Jul 24 11:47:04 2017
@@ -1,11 +1,15 @@
-# Copyright 2002-2004 The Apache Software Foundation
-
+#
+# init.tcl --
+#
+#
+# Copyright 2002-2017 The Apache Rivet Team
+#
# 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.
Modified: tcl/rivet/trunk/rivet/init.tcl.in
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/init.tcl.in?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/init.tcl.in (original)
+++ tcl/rivet/trunk/rivet/init.tcl.in Mon Jul 24 11:47:04 2017
@@ -1,11 +1,15 @@
-# Copyright 2002-2004 The Apache Software Foundation
-
+#
+# init.tcl --
+#
+#
+# Copyright 2002-2017 The Apache Rivet Team
+#
# 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.
Modified: tcl/rivet/trunk/rivet/packages/calendar/calendar.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/packages/calendar/calendar.tcl?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/packages/calendar/calendar.tcl (original)
+++ tcl/rivet/trunk/rivet/packages/calendar/calendar.tcl Mon Jul 24 11:47:04 2017
@@ -1,18 +1,19 @@
+# calendar.tcl ---
#
-# 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.
+# Copyright 2010 The Apache Rivet Team
#
+# 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: calendar.tcl 916 2010-07-03 00:37:44Z massimo.manghi $
@@ -41,7 +42,6 @@ package require Itcl
#
#
-
::itcl::class Calendar {
public common month_names
public common day_names
@@ -72,10 +72,10 @@ package require Itcl
public method emit { args }
constructor {args} {
- set month_names(en) { Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec }
- set month_names(it) { Gen Feb Mar Apr Mag Giu Lug Ago Set Ott Nov Dic }
- set day_names(en) { Su Mo Tu We Th Fr Sa }
- set day_names(it) { Do Lu Ma Me Gi Ve Sa }
+ set month_names(en) { Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec }
+ set month_names(it) { Gen Feb Mar Apr Mag Giu Lug Ago Set Ott Nov Dic }
+ set day_names(en) { Su Mo Tu We Th Fr Sa }
+ set day_names(it) { Do Lu Ma Me Gi Ve Sa }
}
}
@@ -212,8 +212,8 @@ package require Itcl
# we proceed to eval import_arguments $args
- set numeric_parameters {}
- eval $this configure $args
+ set numeric_parameters {}
+ eval $this configure $args
} else {
@@ -224,8 +224,8 @@ package require Itcl
# we assume the rest of the args are in the form -opt1 val1 -opt2 val2 ...
# we proceed to eval import_arguments [lrange $args 2 end]
- set numeric_parameters [lrange $args 0 1]
- eval $this configure [lrange $args 2 end]
+ set numeric_parameters [lrange $args 0 1]
+ eval $this configure [lrange $args 2 end]
}
} else {
@@ -238,58 +238,58 @@ package require Itcl
}
} else {
- set numeric_parameters $args
+ set numeric_parameters $args
}
set argsnumber [llength $numeric_parameters]
switch $argsnumber {
- 1 {
+ 1 {
-# if only one argument is passed to this procedure then we treat it as either as a
-# year (therefore must be a number) or a month name of the current year
+ # if only one argument is passed to this procedure then we treat it as either as a
+ # year (therefore must be a number) or a month name of the current year
- if {[regexp {^[0-9]+$} $numeric_parameters]} {
- set res {}
- set year $numeric_parameters
- for {set m 0} {$m < 12} {incr m} {
- append res [cal $m $year]\n\n
- }
-
- return [string trimright $res]
- }
+ if {[regexp {^[0-9]+$} $numeric_parameters]} {
+ set res {}
+ set year $numeric_parameters
+ for {set m 0} {$m < 12} {incr m} {
+ append res [cal $m $year]\n\n
+ }
+
+ return [string trimright $res]
+ }
- set month_idx [lsearch $month_names($language) $numeric_parameters]
- if {$month_idx >= 0} {
- set year [clock format [clock sec] -format %Y]
- return [cal $month_idx $year]
- } else {
- return ""
+ set month_idx [lsearch $month_names($language) $numeric_parameters]
+ if {$month_idx >= 0} {
+ set year [clock format [clock sec] -format %Y]
+ return [cal $month_idx $year]
+ } else {
+ return ""
+ }
}
- }
- 2 {
+ 2 {
-# two args: the first is the month, the second the year.
+ # two args: the first is the month, the second the year.
- set month [lindex $numeric_parameters 0]
- set year [lindex $numeric_parameters 1]
+ set month [lindex $numeric_parameters 0]
+ set year [lindex $numeric_parameters 1]
- if {[regexp {^\d{1,2}$} $month mat] && ($month > 0) && ($month <= 12)} {
- return [cal [incr month -1] $year]
- } elseif { [lsearch $month_names($language) $month] >= 0} {
- return [cal [lsearch $month_names($language) $month] $year]
+ if {[regexp {^\d{1,2}$} $month mat] && ($month > 0) && ($month <= 12)} {
+ return [cal [incr month -1] $year]
+ } elseif { [lsearch $month_names($language) $month] >= 0} {
+ return [cal [lsearch $month_names($language) $month] $year]
+ }
}
- }
- 0 -
- default {
+ 0 -
+ default {
- # no arguments, we take today as reference
-
+ # no arguments, we take today as reference
+
scan [clock format [clock seconds] -format %m] "%d" month
- set year [format "%d" [clock format [clock sec] -format %Y]]
- return [cal [incr month -1] $year]
+ set year [format "%d" [clock format [clock sec] -format %Y]]
+ return [cal [incr month -1] $year]
- }
+ }
}
}
@@ -382,9 +382,9 @@ package require Itcl
::itcl::body XmlCalendar::getParameters {param what} {
if {[dict exists $parameters $param $what]} {
- return [dict get $parameters $param $what]
+ return [dict get $parameters $param $what]
} else {
- return ""
+ return ""
}
}
@@ -397,7 +397,7 @@ package require Itcl
::itcl::body XmlCalendar::validateWeekday { wkd } {
if {$wkd == "today"} {
- set current_weekday [clock format [clock scan today] -format %w]
+ set current_weekday [clock format [clock scan today] -format %w]
}
}
@@ -426,7 +426,6 @@ package require Itcl
# a bar showing the weekdays with their markup.
#
-
::itcl::body XmlCalendar::header {mth_idx yr} {
set header_tag [getParameters header tag]
set header_att [getParameters header attr]
@@ -473,18 +472,17 @@ package require Itcl
array set attributes $tagattr
if {$day == $current_day} {
- set attributes(class) current
+ set attributes(class) current
}
if {$cell_function != "" && $day != ""} {
+ set month_year [$this cal_processed]
- set month_year [$this cal_processed]
-
- set month [lindex $month_names(en) [lindex $month_year 0]]
- set year [lindex $month_year 1]
- set wkday [clock format [clock scan "$month $day $year"] -format %w]
+ set month [lindex $month_names(en) [lindex $month_year 0]]
+ set year [lindex $month_year 1]
+ set wkday [clock format [clock scan "$month $day $year"] -format %w]
- array set attributes [eval $cell_function $day $month_year $wkday]
+ array set attributes [eval $cell_function $day $month_year $wkday]
}
set tagattr [array get attributes]
Modified: tcl/rivet/trunk/rivet/packages/formbroker/formbroker.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/packages/formbroker/formbroker.tcl?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/packages/formbroker/formbroker.tcl (original)
+++ tcl/rivet/trunk/rivet/packages/formbroker/formbroker.tcl Mon Jul 24 11:47:04 2017
@@ -260,7 +260,7 @@ namespace eval FormBroker {
upvar $_var_d var_d
dict with var_d {
- if {[regexp -nocase {Y|N|0|1} $var]} {
+ if {[string is boolean $var]} {
return FB_OK
} else {
return FB_INVALID_BOOLEAN
Modified: tcl/rivet/trunk/src/mod_rivet_ng/apache_config.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/apache_config.c?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/apache_config.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/apache_config.c Mon Jul 24 11:47:04 2017
@@ -464,7 +464,9 @@ Rivet_CreateConfig(apr_pool_t *p, server
rsc->rivet_child_init_script = NULL;
rsc->rivet_child_exit_script = NULL;
rsc->rivet_before_script = NULL;
- rsc->request_handler = "::Rivet::request_handling";
+ //rsc->request_handler = "::Rivet::request_handling";
+ rsc->request_handler = NULL;
+
rsc->rivet_after_script = NULL;
rsc->rivet_error_script = NULL;
rsc->rivet_abort_script = NULL;
Modified: tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet.c?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet.c Mon Jul 24 11:47:04 2017
@@ -57,77 +57,12 @@
#include "mod_rivet_common.h"
#include "mod_rivet_generator.h"
-rivet_interp_globals interp_globals;
-
extern Tcl_ChannelType RivetChan;
apr_threadkey_t* rivet_thread_key = NULL;
mod_rivet_globals* module_globals = NULL;
-#define ERRORBUF_SZ 256
-
-/*
- * -- Rivet_Exit_Handler
- *
- *
- *
- */
-
-int Rivet_Exit_Handler(int code)
-{
- //Tcl_Exit(code);
- /*NOTREACHED*/
- return TCL_OK; /* Better not ever reach this! */
-}
-
-/*
- * -- Rivet_RunServerInit
- *
- */
-
-static int
-Rivet_RunServerInit (apr_pool_t *pPool, apr_pool_t *pLog, apr_pool_t *pTemp, server_rec *s)
-{
- rivet_server_conf* rsc = RIVET_SERVER_CONF( s->module_config );
-
- FILEDEBUGINFO;
-
- /* we create and initialize a master (server) interpreter */
-
- module_globals->server_interp = Rivet_NewVHostInterp(pPool,s); /* root interpreter */
-
- /* We initialize the interpreter and we won't register a channel with it because
- * we couldn't send data to the stdout anyway */
-
- Rivet_PerInterpInit(module_globals->server_interp,NULL,s,pPool);
-
- /* We don't create the cache here: it would make sense for prefork MPM
- * but threaded MPM bridges have their pool of threads. Each of them
- * will by now have their own cache
- */
-
- if (rsc->rivet_server_init_script != NULL) {
- Tcl_Interp* interp = module_globals->server_interp->interp;
- Tcl_Obj* server_init = Tcl_NewStringObj(rsc->rivet_server_init_script,-1);
-
- Tcl_IncrRefCount(server_init);
-
- if (Tcl_EvalObjEx(interp, server_init, 0) != TCL_OK)
- {
- ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s,
- MODNAME ": Error running ServerInitScript '%s': %s",
- rsc->rivet_server_init_script,
- Tcl_GetVar(interp, "errorInfo", 0));
- } else {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
- MODNAME ": ServerInitScript '%s' successful",
- rsc->rivet_server_init_script);
- }
-
- Tcl_DecrRefCount(server_init);
- }
-
- return OK;
-}
+#define ERRORBUF_SZ 256
+#define TCL_HANDLER_FILE RIVET_DIR"/default_request_handler.tcl"
/*
* -- Rivet_SeekMPMBridge
@@ -208,6 +143,112 @@ Rivet_SeekMPMBridge (apr_pool_t* pool,se
return mpm_bridge_path;
}
+/*
+ * -- Rivet_CreateModuleGlobals
+ *
+ * module globals (mod_rivet_globals) allocation and initialization
+ *
+ */
+
+static mod_rivet_globals*
+Rivet_CreateModuleGlobals (apr_pool_t* pool, server_rec* server)
+{
+ mod_rivet_globals* mod_rivet_g;
+
+ mod_rivet_g = apr_palloc(pool,sizeof(mod_rivet_globals));
+ if (apr_pool_create(&mod_rivet_g->pool, NULL) != APR_SUCCESS)
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server,
+ MODNAME ": could not initialize rivet module global pool");
+ exit(1);
+ }
+
+ mod_rivet_g->rivet_mpm_bridge = Rivet_SeekMPMBridge(pool,server);
+
+ /* read the default request handler code */
+
+ if (Rivet_ReadFile(pool,TCL_HANDLER_FILE,
+ &mod_rivet_g->default_handler,
+ &mod_rivet_g->default_handler_size) > 0)
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server,
+ MODNAME ": could not read rivet default handler");
+ exit(1);
+ }
+
+ /* We cannot assume we are running in an OS with a fork system call
+ * therefore we have to check module_globals in order to establish if the
+ * structure has to be allocated
+ */
+
+ mod_rivet_g->server = server;
+
+ return mod_rivet_g;
+}
+
+/*
+ * -- Rivet_Exit_Handler
+ *
+ *
+ *
+ */
+
+int Rivet_Exit_Handler(int code)
+{
+ //Tcl_Exit(code);
+ /*NOTREACHED*/
+ return TCL_OK; /* Better not ever reach this! */
+}
+
+/*
+ * -- Rivet_RunServerInit
+ *
+ */
+
+static int
+Rivet_RunServerInit (apr_pool_t *pPool, apr_pool_t *pLog, apr_pool_t *pTemp, server_rec *s)
+{
+ rivet_server_conf* rsc = RIVET_SERVER_CONF( s->module_config );
+
+ FILEDEBUGINFO;
+
+ /* we create and initialize a master (server) interpreter */
+
+ module_globals->server_interp = Rivet_NewVHostInterp(pPool,s); /* root interpreter */
+
+ /* We initialize the interpreter and we won't register a channel with it because
+ * we couldn't send data to the stdout anyway */
+
+ Rivet_PerInterpInit(module_globals->server_interp,NULL,s,pPool);
+
+ /* We don't create the cache here: it would make sense for prefork MPM
+ * but threaded MPM bridges have their pool of threads. Each of them
+ * will by now have their own cache
+ */
+
+ if (rsc->rivet_server_init_script != NULL) {
+ Tcl_Interp* interp = module_globals->server_interp->interp;
+ Tcl_Obj* server_init = Tcl_NewStringObj(rsc->rivet_server_init_script,-1);
+
+ Tcl_IncrRefCount(server_init);
+
+ if (Tcl_EvalObjEx(interp, server_init, 0) != TCL_OK)
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s,
+ MODNAME ": Error running ServerInitScript '%s': %s",
+ rsc->rivet_server_init_script,
+ Tcl_GetVar(interp, "errorInfo", 0));
+ } else {
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ MODNAME ": ServerInitScript '%s' successful",
+ rsc->rivet_server_init_script);
+ }
+
+ Tcl_DecrRefCount(server_init);
+ }
+
+ return OK;
+}
/* -- Rivet_ServerInit
*
@@ -227,22 +268,13 @@ Rivet_ServerInit (apr_pool_t *pPool, apr
ap_add_version_component(pPool,RIVET_PACKAGE_NAME);
#endif
- /* Everything revolves around this structure */
-
- module_globals = apr_palloc(pPool,sizeof(mod_rivet_globals));
-
- /* Creating the module global pool */
+ /* Everything revolves around this structure: module_globals */
- if (apr_pool_create(&module_globals->pool, NULL) != APR_SUCCESS)
- {
- ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server,
- MODNAME ": could not initialize mod_rivet private pool");
- exit(1);
- }
+ /* the module global structure is allocated and the MPM bridge name established */
- module_globals->rivet_mpm_bridge = Rivet_SeekMPMBridge(pTemp,server);
+ module_globals = Rivet_CreateModuleGlobals (pPool,server);
- /* Finally the bridge is loaded and the jump table sought */
+ /* The bridge is loaded and the jump table sought */
if (apr_dso_load(&dso_handle,module_globals->rivet_mpm_bridge,pPool) == APR_SUCCESS)
{
@@ -273,18 +305,6 @@ Rivet_ServerInit (apr_pool_t *pPool, apr
apr_thread_mutex_create(&module_globals->pool_mutex, APR_THREAD_MUTEX_UNNESTED, pPool);
- /* Another crucial point: we are storing in the globals a reference to the
- * root server_rec object from which threads are supposed to derive
- * all the other chain of virtual hosts server records
- */
-
- module_globals->server = server;
-
- //ap_assert (apr_threadkey_private_create (&rivet_thread_key, NULL, pPool) == APR_SUCCESS);
- //private = Rivet_CreatePrivateData();
- //ap_assert (private != NULL);
- //Rivet_SetupTclPanicProc ();
-
}
else
{
@@ -329,18 +349,27 @@ static void Rivet_ChildInit (apr_pool_t
ap_assert (apr_threadkey_private_create (&rivet_thread_key, NULL, pChild) == APR_SUCCESS);
-/* This code is run once per child process. In a threaded Tcl builds the forking
- * of a child process most likely has not preserved the thread where the Tcl
- * notifier runs. The Notifier should have been restarted by one the
- * pthread_atfork callbacks (setup in Tcl >= 8.5.14 and Tcl >= 8.6.1). In
- * case pthread_atfork is not supported we unconditionally call Tcl_InitNotifier
- * hoping for the best (Bug #55153)
- */
+ /* This code is run once per child process. In a threaded Tcl builds the forking
+ * of a child process most likely has not preserved the thread where the Tcl
+ * notifier runs. The Notifier should have been restarted by one the
+ * pthread_atfork callbacks (setup in Tcl >= 8.5.14 and Tcl >= 8.6.1). In
+ * case pthread_atfork is not supported we unconditionally call Tcl_InitNotifier
+ * hoping for the best (Bug #55153)
+ */
#if !defined(HAVE_PTHREAD_ATFORK)
Tcl_InitNotifier();
#endif
+ if (module_globals == NULL)
+ {
+ module_globals = Rivet_CreateModuleGlobals (pChild,server);
+ }
+
+ /* This mutex should protect the process wide pool from concurrent access by
+ * different threads
+ */
+
apr_thread_mutex_create(&module_globals->pool_mutex, APR_THREAD_MUTEX_UNNESTED, pChild);
/* Once we have established a pool with the same lifetime of the child process we
Modified: tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet.h?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet.h (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet.h Mon Jul 24 11:47:04 2017
@@ -64,10 +64,10 @@
/* End Configuration options */
#define VAR_SRC_QUERYSTRING 1
-#define VAR_SRC_POST 2
-#define VAR_SRC_ALL 3
+#define VAR_SRC_POST 2
+#define VAR_SRC_ALL 3
-#define DEFAULT_ERROR_MSG "[an error occurred while processing this directive]"
+#define DEFAULT_ERROR_MSG "[an error occurred while processing this directive]"
#define DEFAULT_TIME_FORMAT "%A, %d-%b-%Y %H:%M:%S %Z"
#define MULTIPART_FORM_DATA 1
@@ -189,6 +189,8 @@ typedef struct _mod_rivet_globals {
server_rec* server; /* default host server_rec obj */
int vhosts_count; /* Number of configured virtual host including
* the root server thus it's supposed to be >= 1 */
+ char* default_handler; /* Default request handler code */
+ int default_handler_size; /* Size of the default_handler buffer */
rivet_thread_interp*
server_interp; /* server and prefork MPM interpreter */
apr_thread_mutex_t* pool_mutex; /* threads commmon pool mutex */
Modified: tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c Mon Jul 24 11:47:04 2017
@@ -1,4 +1,6 @@
-/* -- mod_rivet_common.c - functions likely to be shared among different versions of mod_rivet.c */
+/* -- mod_rivet_common.c - functions likely to be shared among
+ * different versions of mod_rivet.c
+ */
/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -23,10 +25,14 @@
#include <httpd.h>
#include <apr_strings.h>
+#include <apr_env.h>
#include <ap_mpm.h>
/* as long as we need to emulate ap_chdir_file we need to include unistd.h */
#include <unistd.h>
+#include <apr_file_io.h>
+#include <apr_file_info.h>
+
#include "mod_rivet.h"
#include "mod_rivet_cache.h"
#include "rivetChannel.h"
@@ -41,6 +47,48 @@ extern apr_threadkey_t* rivet_thread_k
extern mod_rivet_globals* module_globals;
/*
+ * -- Rivet_ReadFile
+ *
+ */
+
+int
+Rivet_ReadFile (apr_pool_t* pool,char* filename,
+ char** buffer,int* nbytes)
+{
+ apr_finfo_t* file_info;
+ apr_file_t* apr_fp;
+ apr_size_t buffer_size;
+
+ *nbytes = 0;
+
+ file_info = (apr_finfo_t*) apr_palloc(pool,sizeof(apr_finfo_t));
+ if (apr_stat(file_info,filename,APR_FINFO_SIZE,pool) != APR_SUCCESS)
+ {
+ return 1;
+ }
+
+ if (apr_file_open(&apr_fp,filename,APR_FOPEN_READ,
+ APR_FPROT_OS_DEFAULT,
+ pool) != APR_SUCCESS)
+ {
+ return 1;
+ }
+
+ buffer_size = file_info->size;
+ *buffer = (char*) apr_palloc(pool,buffer_size);
+
+ if (apr_file_read(apr_fp,*buffer,&buffer_size) != APR_SUCCESS)
+ {
+ return 2;
+ }
+
+ apr_file_close(apr_fp);
+
+ *nbytes = buffer_size;
+ return 0;
+}
+
+/*
*-----------------------------------------------------------------------------
* Rivet_CreateTclInterp --
*
@@ -82,15 +130,17 @@ Rivet_CreateTclInterp (server_rec* s)
return interp;
}
-/*----------------------------------------------------------------------------
+/*---------------------------------------------------------------------
* -- Rivet_RunningScripts
*
*
*
- *-----------------------------------------------------------------------------
+ *---------------------------------------------------------------------
*/
-running_scripts* Rivet_RunningScripts (apr_pool_t* pool,running_scripts* scripts,rivet_server_conf* rivet_conf)
+running_scripts* Rivet_RunningScripts ( apr_pool_t* pool,
+ running_scripts* scripts,
+ rivet_server_conf* rivet_conf )
{
RIVET_SCRIPT_INIT (pool,scripts,rivet_conf,rivet_before_script);
RIVET_SCRIPT_INIT (pool,scripts,rivet_conf,rivet_after_script);
@@ -98,14 +148,29 @@ running_scripts* Rivet_RunningScripts (a
RIVET_SCRIPT_INIT (pool,scripts,rivet_conf,rivet_abort_script);
RIVET_SCRIPT_INIT (pool,scripts,rivet_conf,after_every_script);
- scripts->request_processing = Tcl_NewStringObj(rivet_conf->request_handler,-1);
+ if (rivet_conf->request_handler != NULL)
+ {
+ char* request_handler;
+ int handler_size;
+
+ ap_assert(Rivet_ReadFile(pool,rivet_conf->request_handler,
+ &request_handler,&handler_size) == 0);
+
+ scripts->request_processing =
+ Tcl_NewStringObj(request_handler,handler_size);
+
+ } else {
+ scripts->request_processing =
+ Tcl_NewStringObj(module_globals->default_handler,
+ module_globals->default_handler_size);
+ }
Tcl_IncrRefCount(scripts->request_processing);
-
+
return scripts;
}
/*
- *-----------------------------------------------------------------------------
+ *---------------------------------------------------------------------
*
* Rivet_PerInterpInit --
*
@@ -117,9 +182,12 @@ running_scripts* Rivet_RunningScripts (a
* Side Effects:
* None.
*
- *-----------------------------------------------------------------------------
+ *---------------------------------------------------------------------
*/
-void Rivet_PerInterpInit(rivet_thread_interp* interp_obj,rivet_thread_private* private, server_rec *s, apr_pool_t *p)
+void Rivet_PerInterpInit(rivet_thread_interp* interp_obj,
+ rivet_thread_private* private,
+ server_rec *s,
+ apr_pool_t *p)
{
rivet_interp_globals* globals = NULL;
Tcl_Obj* auto_path = NULL;
@@ -397,7 +465,7 @@ rivet_thread_private* Rivet_CreatePrivat
/*
* -- Rivet_ExecutionThreadInit
*
- * We keep here the basic initilization each execution thread likely does
+ * We keep here the basic initilization each execution thread should undergo
*
* - create the thread private data
* - create a Tcl channel
@@ -670,7 +738,8 @@ void Rivet_InitServerVariables( Tcl_Inte
* the directory name is everything comes
* before the last '/' (slash) character
*
- * This snippet of code came from the mod_ruby project, which is under a BSD license.
+ * This snippet of code came from the mod_ruby project,
+ * which is under a BSD license.
*/
int Rivet_chdir_file (const char *file)
Modified: tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.h?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.h (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.h Mon Jul 24 11:47:04 2017
@@ -21,6 +21,7 @@
#ifndef _MOD_RIVET_COMMON_
#define _MOD_RIVET_COMMON_
+
EXTERN running_scripts* Rivet_RunningScripts (apr_pool_t* pool,running_scripts* scripts,rivet_server_conf* rivet_conf);
EXTERN void Rivet_PerInterpInit(rivet_thread_interp* interp_obj,rivet_thread_private* private, server_rec *s, apr_pool_t *p);
EXTERN void Rivet_CreateCache (apr_pool_t *p, rivet_thread_interp* interp_obj);
@@ -35,5 +36,6 @@ EXTERN rivet_thread_private* Rivet_Creat
EXTERN rivet_thread_private* Rivet_ExecutionThreadInit (void);
EXTERN rivet_thread_private* Rivet_SetupTclPanicProc (void);
EXTERN void Rivet_ReleaseRivetChannel (Tcl_Interp* interp, Tcl_Channel* channel);
+EXTERN int Rivet_ReadFile (apr_pool_t* pool,char* filename,char** buffer,int* nbytes);
#endif
Modified: tcl/rivet/trunk/src/mod_rivet_ng/rivet_lazy_mpm.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/rivet_lazy_mpm.c?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/rivet_lazy_mpm.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/rivet_lazy_mpm.c Mon Jul 24 11:47:04 2017
@@ -38,7 +38,6 @@
extern mod_rivet_globals* module_globals;
extern apr_threadkey_t* rivet_thread_key;
-extern apr_threadkey_t* handler_thread_key;
enum
{
Modified: tcl/rivet/trunk/src/mod_rivet_ng/rivet_prefork_mpm.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/rivet_prefork_mpm.c?rev=1802791&r1=1802790&r2=1802791&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/rivet_prefork_mpm.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/rivet_prefork_mpm.c Mon Jul 24 11:47:04 2017
@@ -48,7 +48,7 @@ apr_status_t Prefork_MPM_Finalize (void*
RIVET_PRIVATE_DATA_NOT_NULL(rivet_thread_key,private)
ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, s, "Running prefork bridge finalize method");
- // No, we don't clean up anymore as we are just shutting this process down
+ // No, we don't do any clean up anymore as we are just shutting this process down
// Rivet_ProcessorCleanup(private);
return OK;
---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org