diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-16 14:54:49 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-16 14:54:49 +0000 |
commit | 73deb733926e8b4cf58949141d11a1083911f227 (patch) | |
tree | 7d730928e2805fc52fa0efa8fc4d8d0c67d43c81 /lib | |
parent | f55662826477e0f75816b2b481817814d224ffd4 (diff) |
* numeric.c (flo_divmod): protect float values from GC by
assignment to local variables. [ruby-dev:24873]
* string.c (str_mod_check): frozen check should be separated.
[ruby-core:3742]
* array.c (rb_ary_update): pedantic check to detect
rb_ary_to_ary() to modify the receiver. [ruby-dev:24861]
* string.c (rb_str_justify): typo fixed. [ruby-dev:24851]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cgi/session.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb index 9a49fdedc9..66ab8fd67e 100644 --- a/lib/cgi/session.rb +++ b/lib/cgi/session.rb @@ -159,7 +159,7 @@ class CGI attr_reader :session_id def Session::callback(dbman) #:nodoc: - lambda{ + Proc.new{ dbman[0].close unless dbman.empty? } end @@ -351,17 +351,21 @@ class CGI # on Unix systems). # prefix:: the prefix to add to the session id when generating # the filename for this session's FileStore file. + # Defaults to "cgi_sid_". + # suffix:: the prefix to add to the session id when generating + # the filename for this session's FileStore file. # Defaults to the empty string. # # This session's FileStore file will be created if it does # not exist, or opened if it does. def initialize(session, option={}) dir = option['tmpdir'] || Dir::tmpdir - prefix = option['prefix'] || '' + prefix = option['prefix'] || 'cgi_sid_' + suffix = option['suffix'] || '' id = session.session_id require 'digest/md5' md5 = Digest::MD5.hexdigest(id)[0,16] - @path = dir+"/"+prefix+md5 + @path = dir+"/"+prefix+md5+suffix unless File::exist? @path @hash = {} end |