Skip Menu |

This queue is for tickets about the CGI-Session CPAN distribution.

Report information
The Basics
Id: 39201
Status: resolved
Priority: 0/
Queue: CGI-Session

People
Owner: Nobody in particular
Requestors: dom [...] math.uni-bonn.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Undefined return code in _set_status
Date: Fri, 12 Sep 2008 08:37:30 +0200
To: bug-CGI-Session [...] rt.cpan.org
From: Mario Domgoergen <dom [...] math.uni-bonn.de>
Hello, following your code example in the documentation, i used $session->delete() or warn "couldn't remove " . $session->id . ": " . $session->errstr; with CGI::Session->find to purge my session entries. But delete() throws a lot of warnings although the entries were removed from my database. As _set_status, which is called by delete(), does not return with an explicit expression, the return code is determined by the for-loop. But perlsub states: <If the last statement is a loop control structure like a "foreach" or a "while", the returned value is unspecified."> As you can use the bit fiddling in the call to _set_status, i don't see really a need for the for-loop. Otherwise i would simple remove the warn statement from the documentation. CGI-Session-4.34 perl, v5.8.8 built for i486-linux-gnu-thread-multi Best regards, Mario -- Mario Domgoergen - Systemadministration Mathematische Institut der Universitaet Bonn Beringstrasse 4, 53115 Bonn / Zimmer 3 Tel.: +49-228-737773 / dom@math.uni-bonn.de
Subject: Re: [rt.cpan.org #39201] Undefined return code in _set_status
Date: Fri, 12 Sep 2008 17:54:24 +1000
To: bug-CGI-Session [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Mario $many x $thanx for the report. Show quoted text
> following your code example in the documentation, i used > > $session->delete() or warn "couldn't remove " . $session->id . ": " . $session->errstr;
This faulty code appears in the docs for find(). I've patched it. Here is the patch to the 'Changes' file: 4.36 - Friday, September 12, 2008 * FIX: The sample code for find() had 2 errors in it: o It assumed delete() returned a meaningful value, which it doesn't o It did not follow the call to delete() with a (recommended) call to flush() o Thanks to Mario Domgoergen for the report, RT#39201 I don't actually issue releases, so I can't say when this will hit CPAN. -- Ron Savage ron@savage.net.au http://savage.net.au/index.html
Subject: Re: [rt.cpan.org #39201] Undefined return code in _set_status
Date: Fri, 12 Sep 2008 09:36:18 -0400
To: bug-CGI-Session [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Show quoted text
> > I don't actually issue releases, so I can't say when this will hit CPAN.
Thanks to you both. I'll try to release this soon. But as Ron points out, the important thing to know here is that it was the docs that were at fault, not a coding a bug. Mark
Subject: Re: [rt.cpan.org #39201] Undefined return code in _set_status
Date: Mon, 15 Sep 2008 11:34:43 +0200
To: "mark [...] summersault.com via RT" <bug-CGI-Session [...] rt.cpan.org>
From: Mario Domgoergen <dom [...] math.uni-bonn.de>
Hello! Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=39201 >
> > > > I don't actually issue releases, so I can't say when this will hit CPAN.
> > Thanks to you both. I'll try to release this soon. But as Ron points out, > the important thing to know here is that it was the docs that were at fault, > not a coding a bug.
sorry for not stating that more clearly. But i wasn't entirely sure if it's just a documentation bug. Sure, the documentation error threw me out of line, but personally i think that it would be convinient for _set_status to return $self->{_STATUS}. And if it's just for not returning a junk return value... Best regards, Mario Domgoergen -- Mario Domgoergen - Systemadministration Mathematische Institut der Universitaet Bonn Beringstrasse 4, 53115 Bonn / Zimmer 3 Tel.: +49-228-737773 / dom@math.uni-bonn.de
Subject: Re: [rt.cpan.org #39201] Undefined return code in _set_status
Date: Mon, 15 Sep 2008 10:32:35 -0400
To: bug-CGI-Session [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Show quoted text
> sorry for not stating that more clearly. But i wasn't entirely sure > if it's just a documentation bug. Sure, the documentation error threw > me out of line, but personally i think that it would be convinient > for _set_status to return $self->{_STATUS}. And if it's just for not > returning a junk return value...
Mario, It sounds like you have a clear idea of what should be done. Could you submit a simple patch? Mark
Subject: Re: [rt.cpan.org #39201] Undefined return code in _set_status
Date: Mon, 15 Sep 2008 16:52:16 +0200
To: "mark [...] summersault.com via RT" <bug-CGI-Session [...] rt.cpan.org>
From: Mario Domgoergen <dom [...] math.uni-bonn.de>
Hello, Show quoted text
> > sorry for not stating that more clearly. But i wasn't entirely sure > > if it's just a documentation bug. Sure, the documentation error threw > > me out of line, but personally i think that it would be convinient > > for _set_status to return $self->{_STATUS}. And if it's just for not > > returning a junk return value...
> > It sounds like you have a clear idea of what should be done. Could you submit a > simple patch?
the problem would be easily solved by applying the patch atteched to #37752. If this is too big a change, i attach a simple patch for the problem. Best regards, Mario -- Mario Domgoergen - Systemadministration Mathematische Institut der Universitaet Bonn Beringstrasse 4, 53115 Bonn / Zimmer 3 Tel.: +49-228-737773 / dom@math.uni-bonn.de

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #39201] Undefined return code in _set_status
Date: Mon, 15 Sep 2008 11:00:14 -0400
To: bug-CGI-Session [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Show quoted text
> the problem would be easily solved by applying the patch atteched to > #37752. If this is too big a change, i attach a simple patch for the > problem.
Thanks! We will review both patches. Mark
On Mon Sep 15 11:00:53 2008, mark@summersault.com wrote: Show quoted text
>
> > the problem would be easily solved by applying the patch atteched to > > #37752. If this is too big a change, i attach a simple patch for the > > problem.
> > Thanks! We will review both patches.
We still start returning an explicit return value in _set_status and _unset_status in the next release. I'm going to look at the page in RT#37752 as well. Thanks for the report. Mark