New Version
Sync with Latest Instiki Trunk. Migrate to Rails 1.2.5. Bump version number.
This commit is contained in:
parent
de125367b0
commit
207fb1f7f2
120 changed files with 2592 additions and 662 deletions
30
vendor/rails/actionpack/lib/action_controller/cgi_ext/pstore_performance_fix.rb
vendored
Normal file
30
vendor/rails/actionpack/lib/action_controller/cgi_ext/pstore_performance_fix.rb
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
# CGI::Session::PStore.initialize requires 'digest/md5' on every call.
|
||||
# This makes sense when spawning processes per request, but is
|
||||
# unnecessarily expensive when serving requests from a long-lived
|
||||
# process.
|
||||
require 'cgi/session'
|
||||
require 'cgi/session/pstore'
|
||||
require 'digest/md5'
|
||||
|
||||
class CGI::Session::PStore #:nodoc:
|
||||
def initialize(session, option={})
|
||||
dir = option['tmpdir'] || Dir::tmpdir
|
||||
prefix = option['prefix'] || ''
|
||||
id = session.session_id
|
||||
md5 = Digest::MD5.hexdigest(id)[0,16]
|
||||
path = dir+"/"+prefix+md5
|
||||
path.untaint
|
||||
if File::exist?(path)
|
||||
@hash = nil
|
||||
else
|
||||
unless session.new_session
|
||||
raise CGI::Session::NoSession, "uninitialized session"
|
||||
end
|
||||
@hash = {}
|
||||
end
|
||||
@p = ::PStore.new(path)
|
||||
@p.transaction do |p|
|
||||
File.chmod(0600, p.path)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -65,7 +65,7 @@ class CGI #:nodoc:
|
|||
if env_qs.blank? && !(uri = env_table['REQUEST_URI']).blank?
|
||||
uri.split('?', 2)[1] || ''
|
||||
else
|
||||
env_qs
|
||||
env_qs || ''
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue