[#3479] Missing .document files for ext/ libraries — Brian Candler <B.Candler@...>

The ri documentation for zlib, strscan and iconv doesn't get built by 'make

12 messages 2004/10/06

[#3492] Re: ANN: Free-form-operators patch — Markus <markus@...>

> In message "Re: ANN: Free-form-operators patch"

15 messages 2004/10/11
[#3493] Re: ANN: Free-form-operators patch — Yukihiro Matsumoto <matz@...> 2004/10/11

Hi,

[#3495] Re: ANN: Free-form-operators patch — Markus <markus@...> 2004/10/12

On Mon, 2004-10-11 at 16:16, Yukihiro Matsumoto wrote:

[#3561] 1.8.2 - what can we do to help? — Dave Thomas <dave@...>

Folks:

23 messages 2004/10/26
[#3562] Re: 1.8.2 - what can we do to help? — Yukihiro Matsumoto <matz@...> 2004/10/27

Hi,

CGI::Session::PStore#restore method

From: Kent Sibilev <ksibilev@...>
Date: 2004-10-11 23:17:32 UTC
List: ruby-core #3494
Recently, I've run into the problem with CGI session resetting. I'm 
using CGI::Session::PStore session manager. Looking at the following 
method:

      def restore
         unless @hash
           @p.transaction do
             begin
               @hash = @p['hash']
             rescue
               @hash = {}
             end
           end
         end
         @hash
       end

from the lib/cgi/session/pstore.rb file made me wonder what this 
begin/rescue is doing there. After a little bit of investigation, it 
turned out that PStore#[] method never throws an exception inside the 
transaction scope. So this piece of code doesn't make any sense at all. 
I'm proposing to fix it by applying this patch:

RCS file: /src/ruby/lib/cgi/session/pstore.rb,v
retrieving revision 1.5
diff -u -r1.5 pstore.rb
--- pstore.rb   24 Aug 2004 07:59:50 -0000      1.5
+++ pstore.rb   11 Oct 2004 23:03:43 -0000
@@ -76,11 +76,7 @@
        def restore
         unless @hash
           @p.transaction do
-           begin
-             @hash = @p['hash']
-           rescue
-             @hash = {}
-           end
+           @hash = @p['hash'] || {}
           end
         end
         @hash

BTW, it fixes my original session reset problem nicely.

Cheers,
Kent.


In This Thread

Prev Next