many many warnings...

T

Tom Allison

[Sat Jul 29 10:40:30 2006] [warn] mod_fcgid: stderr:
/usr/lib/ruby/1.8/cgi/session.rb:312: warning: instance variable
@write_lock not initialized
[Sat Jul 29 10:40:30 2006] [warn] mod_fcgid: stderr:
/usr/lib/ruby/1.8/cgi/session.rb:315: warning: instance variable @data
not initialized
[Sat Jul 29 10:40:30 2006] [warn] mod_fcgid: stderr:
/usr/lib/ruby/1.8/cgi/session.rb:395: warning: instance variable @hash
not initialized


I run my fcgi script under ruby -w.
I don't think these are related to the FileStore storage that I'm using,
rather the PStore. Is this something that can be fixed or am I doing it
wrong?
 
N

nobu

Hi,

At Sun, 30 Jul 2006 01:43:47 +0900,
Tom Allison wrote in [ruby-talk:204896]:
I run my fcgi script under ruby -w.
I don't think these are related to the FileStore storage that I'm using,
rather the PStore. Is this something that can be fixed or am I doing it
wrong?

Does this make it gentle?


Index: lib/cgi/session.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/cgi/session.rb,v
retrieving revision 1.23.2.15
diff -p -u -2 -r1.23.2.15 session.rb
--- lib/cgi/session.rb 7 Mar 2005 00:20:15 -0000 1.23.2.15
+++ lib/cgi/session.rb 30 Jul 2006 01:07:01 -0000
@@ -302,7 +302,5 @@ class CGI
# Retrieve the session data for key +key+.
def [](key)
- unless @data
- @data = @dbman.restore
- end
+ @data ||= @dbman.restore
@data[key]
end
@@ -310,10 +308,6 @@ class CGI
# Set the session date for key +key+.
def []=(key, val)
- unless @write_lock
- @write_lock = true
- end
- unless @data
- @data = @dbman.restore
- end
+ @write_lock ||= true
+ @data ||= @dbman.restore
@data[key] = val
end
@@ -375,5 +369,5 @@ class CGI
def initialize(session, option={})
dir = option['tmpdir'] || Dir::tmpdir
- prefix = option['prefix'] || ''
+ prefix = option['prefix'] || ''
suffix = option['suffix'] || ''
id = session.session_id
@@ -381,5 +375,7 @@ class CGI
md5 = Digest::MD5.hexdigest(id)[0,16]
@path = dir+"/"+prefix+md5+suffix
- unless File::exist? @path
+ if File::exist? @path
+ @hash = nil
+ else
unless session.new_session
raise CGI::Session::NoSession, "uninitialized session"
cvs diff: Diffing lib/cgi/session
Index: lib/cgi/session/pstore.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/cgi/session/pstore.rb,v
retrieving revision 1.3.2.5
diff -p -u -2 -r1.3.2.5 pstore.rb
--- lib/cgi/session/pstore.rb 15 Dec 2004 01:54:37 -0000 1.3.2.5
+++ lib/cgi/session/pstore.rb 30 Jul 2006 01:09:17 -0000
@@ -15,15 +15,4 @@ require 'pstore'
class CGI
class Session
- def []=(key, val)
- unless @write_lock
- @write_lock = true
- end
- unless @data
- @data = @dbman.restore
- end
- #@data[key] = String(val)
- @data[key] = val
- end
-
# PStore-based session storage class.
#
@@ -54,5 +43,5 @@ class CGI
# This session's PStore file will be created if it does
# not exist, or opened if it does.
- def initialize session, option={}
+ def initialize(session, option={})
dir = option['tmpdir'] || Dir::tmpdir
prefix = option['prefix'] || ''
@@ -62,5 +51,7 @@ class CGI
path = dir+"/"+prefix+md5
path.untaint
- unless File::exist?(path)
+ if File::exist?(path)
+ @hash = nil
+ else
unless session.new_session
raise CGI::Session::NoSession, "uninitialized session"
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: many many warnings..."
on Sun, 30 Jul 2006 10:11:54 +0900, (e-mail address removed) writes:

|At Sun, 30 Jul 2006 01:43:47 +0900,
|Tom Allison wrote in [ruby-talk:204896]:
|> I run my fcgi script under ruby -w.
|> I don't think these are related to the FileStore storage that I'm using,
|> rather the PStore. Is this something that can be fixed or am I doing it
|> wrong?
|
|Does this make it gentle?

Hmm, can you check in?

matz.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top