[Rt-commit] r5356 - in HTTP-Server-Simple: .

jesse at bestpractical.com jesse at bestpractical.com
Wed Jun 14 11:13:19 EDT 2006


Author: jesse
Date: Wed Jun 14 11:13:16 2006
New Revision: 5356

Modified:
   HTTP-Server-Simple/   (props changed)
   HTTP-Server-Simple/lib/HTTP/Server/Simple.pm

Log:
 r12568 at pinglin:  jesse | 2006-06-14 17:12:16 +0200
 
 Tue Jun 13 09:39:27 2006: Request 19875 was acted upon.                                      
 Transaction: Ticket created by SJQUINNEY                                                     
        Queue: HTTP-Server-Simple                                                             
      Subject: Incorrect setup() method                                                       
    Broken in: 0.18                                                                           
     Severity: Normal                                                                         
        Owner: Nobody                                                                         
   Requestors: sjq at debian.org                                                                 
       Status: new                                                                            
  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=19875 >                              
 
 
 The setup() method in HTTP::Server::Simple has been coded incorrectly.                       
 It currently looks like this:                                                                
                                                                                              
 sub setup {                                                                                  
     my ($self) = @_;                                                                         
                                                                                              
     while ( my ( $item, $value ) = splice @_, 0, 2 ) {                                       
         $self->$item($value) if $self->can($item);                                           
     }                                                                                        
 }                                                                                            
                                                                                              
 Because $self is not shifted off @_ the while(splice) goes through the                       
 list of key-value pairs incorrectly and none of the methods ever get called.                 
                                                                                              
 I suspect this hasn't been spotted before as most people will be                             
 subclassing HTTP::Server::Simple::CGI which overrides the setup() method.                    
                                                                                              
 Attached is a patch against 0.18.                                                            
 


Modified: HTTP-Server-Simple/lib/HTTP/Server/Simple.pm
==============================================================================
--- HTTP-Server-Simple/lib/HTTP/Server/Simple.pm	(original)
+++ HTTP-Server-Simple/lib/HTTP/Server/Simple.pm	Wed Jun 14 11:13:16 2006
@@ -422,7 +422,7 @@
 =cut
 
 sub setup {
-    my ($self) = @_;
+    my $self shift;
     while ( my ( $item, $value ) = splice @_, 0, 2 ) {
         $self->$item($value) if $self->can($item);
     }


More information about the Rt-commit mailing list