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 2016/12/07 12:48:07 UTC

svn commit: r1773067 - in /tcl/rivet/branches/2.3: ChangeLog rivet/packages/form/form.tcl rivet/packages/form/form2.tcl rivet/packages/session/session-class.tcl src/librivet/rivetWWW.c

Author: mxmanghi
Date: Wed Dec  7 12:48:06 2016
New Revision: 1773067

URL: http://svn.apache.org/viewvc?rev=1773067&view=rev
Log:
    * rivet/packages/session/session-class.tcl:
    * rivet/packages/session/form*.tcl: fully qualifying
    ::rivet::* command names in this packages
    * src/librivet/rivetWWW.c: new buffer size allocation
    to prevent apache from crashing when too many
    characters needed escaping are in a string


Modified:
    tcl/rivet/branches/2.3/ChangeLog
    tcl/rivet/branches/2.3/rivet/packages/form/form.tcl
    tcl/rivet/branches/2.3/rivet/packages/form/form2.tcl
    tcl/rivet/branches/2.3/rivet/packages/session/session-class.tcl
    tcl/rivet/branches/2.3/src/librivet/rivetWWW.c

Modified: tcl/rivet/branches/2.3/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/ChangeLog?rev=1773067&r1=1773066&r2=1773067&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/ChangeLog (original)
+++ tcl/rivet/branches/2.3/ChangeLog Wed Dec  7 12:48:06 2016
@@ -1,3 +1,11 @@
+2016-12-07 Massimo Manghi <mx...@apache.org>
+    * rivet/packages/session/session-class.tcl:
+    * rivet/packages/session/form*.tcl: fully qualifying
+    ::rivet::* command names in this packages
+    * src/librivet/rivetWWW.c: new buffer size allocation
+    to prevent apache from crashing when too many
+    characters needed escaping are in a string
+
 2016-11-28 Massimo Manghi <mx...@apache.org>
     * .: releasing rivet 2.3.3
 

Modified: tcl/rivet/branches/2.3/rivet/packages/form/form.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/rivet/packages/form/form.tcl?rev=1773067&r1=1773066&r2=1773067&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/rivet/packages/form/form.tcl (original)
+++ tcl/rivet/branches/2.3/rivet/packages/form/form.tcl Wed Dec  7 12:48:06 2016
@@ -179,14 +179,14 @@ package provide form 1.0
             # replicated in constructor
             import_data form $this arguments $args
         }
-        html "<form [argstring arguments]>"
+        ::rivet::html "<form [argstring arguments]>"
     }
 
     #
     # end - generate the </form>
     #
     method end {} {
-        html "</form>"
+        ::rivet::html "</form>"
     }
 
     #
@@ -247,7 +247,7 @@ package provide form 1.0
         }
 
         # ...and emit it
-        html $string
+        ::rivet::html $string
 
     }
 
@@ -475,7 +475,7 @@ package provide form 1.0
         }
 
         # emit the selector
-        html "<select name=\"$name\" [argstring data]>"
+        ::rivet::html "<select name=\"$name\" [argstring data]>"
 
         # emit each label-value pair
         foreach label $labels value $values {
@@ -484,9 +484,9 @@ package provide form 1.0
             } else {
             set string "<option value=\"$value\">"
             }
-            html "$string$label</option>"
+            ::rivet::html "$string$label</option>"
         }
-        html "</select>"
+        ::rivet::html "</select>"
     }
 
     #
@@ -499,7 +499,7 @@ package provide form 1.0
             set value $data(value)
             unset data(value)
         }
-        html "<textarea name=\"$name\" [argstring data]>$value</textarea>"
+        ::rivet::html "<textarea name=\"$name\" [argstring data]>$value</textarea>"
     }
 
     #

Modified: tcl/rivet/branches/2.3/rivet/packages/form/form2.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/rivet/packages/form/form2.tcl?rev=1773067&r1=1773066&r2=1773067&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/rivet/packages/form/form2.tcl (original)
+++ tcl/rivet/branches/2.3/rivet/packages/form/form2.tcl Wed Dec  7 12:48:06 2016
@@ -242,14 +242,14 @@ package provide form 2.1
             # replicated in constructor
             import_data form $this arguments $args
         }
-        html "<form [argstring arguments]>"
+        ::rivet::html "<form [argstring arguments]>"
     }
 
     #
     # end - generate the </form>
     #
     method end {} {
-        html "</form>"
+        ::rivet::html "</form>"
     }
 
     #
@@ -311,7 +311,7 @@ package provide form 2.1
         }
 
         # ...and emit it
-        html $string
+        ::rivet::html $string
 
     }
 
@@ -587,7 +587,7 @@ package provide form 2.1
         } elseif {[default_exists $name]} {
 			set value [default_value_get $name]
 		}
-        html "<textarea name=\"$name\" [argstring data]>$value</textarea>"
+        ::rivet::html "<textarea name=\"$name\" [argstring data]>$value</textarea>"
     }
 
     #

Modified: tcl/rivet/branches/2.3/rivet/packages/session/session-class.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/rivet/packages/session/session-class.tcl?rev=1773067&r1=1773066&r2=1773067&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/rivet/packages/session/session-class.tcl (original)
+++ tcl/rivet/branches/2.3/rivet/packages/session/session-class.tcl Wed Dec  7 12:48:06 2016
@@ -150,7 +150,7 @@ package require Itcl
 	# if the Apache unique ID module is installed, the environment
 	# variable UNIQUE_ID will have been set.  If not, we'll get an
 	# empty string, which won't hurt anything.
-	set uniqueID [env UNIQUE_ID]
+	set uniqueID [::rivet::env UNIQUE_ID]
 
 	set sessionIdKey "$uniqueID[clock clicks][pid]$args[clock seconds]$scrambleCode[get_entropy_bytes]"
 	debug "gen_session_id - feeding this to md5: '$sessionIdKey'"
@@ -192,7 +192,7 @@ package require Itcl
     #  object
     #
     method set_session_cookie {value} {
-	cookie set $cookieName $value \
+	::rivet::cookie set $cookieName $value \
 	    -path $cookiePath \
 	    -minutes $cookieLifetime \
 	    -secure $cookieSecure \
@@ -231,7 +231,7 @@ package require Itcl
 	# see if they have a session cookie.  if they don't,
 	# set status and return.
 	#
-	set sessionCookie [cookie get $cookieName]
+	set sessionCookie [::rivet::cookie get $cookieName]
 	if {$sessionCookie == ""} {
 	    # they did not have a cookie set, they are not logged in
 	    status "no_cookie"
@@ -247,14 +247,14 @@ package require Itcl
 	debug "id: found session cookie '$cookieName' value '$sessionCookie'"
 
 	set a(session_id) $sessionCookie
-	set a(ip_address) [env REMOTE_ADDR]
+	set a(ip_address) [::rivet::env REMOTE_ADDR]
 
 	# see if there's a record matching the session ID cookie and
 	# IP address
 	set kf [list session_id ip_address]
 	set key [$dioObject makekey a $kf]
 	if {![$dioObject fetch $key a -table $sessionTable -keyfield $kf]} {
-	    debug "id: no entry in the session table for session '$sessionCookie' and address [env REMOTE_ADDR]: [$dioObject errorinfo]"
+	    debug "id: no entry in the session table for session '$sessionCookie' and address [::rivet::env REMOTE_ADDR]: [$dioObject errorinfo]"
 	    status "no_session"
 	    return ""
 	}
@@ -383,7 +383,7 @@ package require Itcl
     #
     method delete_session {{session_id ""}} {
 
-	set ip_address [env REMOTE_ADDR]
+	set ip_address [::rivet::env REMOTE_ADDR]
 
 	if {$session_id == ""} {
 	    set session_id [id]
@@ -408,7 +408,7 @@ package require Itcl
 
 	## Create their session by storing their session information in 
 	# the session table.
-	set a(ip_address) [env REMOTE_ADDR]
+	set a(ip_address) [::rivet::env REMOTE_ADDR]
 	set a(session_start_time) now
 	set a(session_update_time) now
 

Modified: tcl/rivet/branches/2.3/src/librivet/rivetWWW.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/src/librivet/rivetWWW.c?rev=1773067&r1=1773066&r2=1773067&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/src/librivet/rivetWWW.c (original)
+++ tcl/rivet/branches/2.3/src/librivet/rivetWWW.c Wed Dec  7 12:48:06 2016
@@ -180,7 +180,7 @@ TCL_CMD_HEADER( Rivet_EscapeStringCmd )
     /* If they sent us an empty string, we're done */
     if (origLength == 0) return TCL_OK;
 
-    newString = (char *)Tcl_Alloc( (unsigned)origLength * 3 + 1 );
+    newString = (char *)Tcl_Alloc( (unsigned)origLength * 6 + 1 );
 
     /* for all the characters in the source string */
     for (origStringP = origString, newStringP = newString;



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org