r29136 - in /branches/upstream/libpoe-component-server-simplehttp-perl/current: Changes META.yml Makefile.PL lib/POE/Component/Server/SimpleHTTP.pm

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Thu Jan 1 22:18:21 UTC 2009


Author: gregoa
Date: Thu Jan  1 22:18:18 2009
New Revision: 29136

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=29136
Log:
[svn-upgrade] Integrating new upstream version, libpoe-component-server-simplehttp-perl (1.50)

Modified:
    branches/upstream/libpoe-component-server-simplehttp-perl/current/Changes
    branches/upstream/libpoe-component-server-simplehttp-perl/current/META.yml
    branches/upstream/libpoe-component-server-simplehttp-perl/current/Makefile.PL
    branches/upstream/libpoe-component-server-simplehttp-perl/current/lib/POE/Component/Server/SimpleHTTP.pm

Modified: branches/upstream/libpoe-component-server-simplehttp-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-component-server-simplehttp-perl/current/Changes?rev=29136&op=diff
==============================================================================
--- branches/upstream/libpoe-component-server-simplehttp-perl/current/Changes (original)
+++ branches/upstream/libpoe-component-server-simplehttp-perl/current/Changes Thu Jan  1 22:18:18 2009
@@ -1,3 +1,17 @@
+========================
+2008-12-17 10:42:57 1.50
+========================
+
+  2008-12-17 10:39:28 (r124) by bingos
+  lib/POE/Component/Server/SimpleHTTP.pm M
+
+    Fix applied for RT #41780
+
+  2008-11-15 08:53:26 (r123) by bingos
+  lib/POE/Component/Server/SimpleHTTP.pm M; Makefile.PL M; Changes M
+
+    Some code tidying
+
 ========================
 2008-09-05 15:39:31 1.48
 ========================

Modified: branches/upstream/libpoe-component-server-simplehttp-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-component-server-simplehttp-perl/current/META.yml?rev=29136&op=diff
==============================================================================
--- branches/upstream/libpoe-component-server-simplehttp-perl/current/META.yml (original)
+++ branches/upstream/libpoe-component-server-simplehttp-perl/current/META.yml Thu Jan  1 22:18:18 2009
@@ -27,6 +27,7 @@
   Socket: 0
   Storable: 0
   Sys::Hostname: 0
+  perl: 5.6.0
 resources:
   license: http://dev.perl.org/licenses/
-version: 1.48
+version: 1.50

Modified: branches/upstream/libpoe-component-server-simplehttp-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-component-server-simplehttp-perl/current/Makefile.PL?rev=29136&op=diff
==============================================================================
--- branches/upstream/libpoe-component-server-simplehttp-perl/current/Makefile.PL (original)
+++ branches/upstream/libpoe-component-server-simplehttp-perl/current/Makefile.PL Thu Jan  1 22:18:18 2009
@@ -4,6 +4,7 @@
 name 'POE-Component-Server-SimpleHTTP';
 author 'Apocalypse <APOCAL at cpan.org>';
 license 'perl';
+perl_version '5.006';
 version_from 'lib/POE/Component/Server/SimpleHTTP.pm';
 abstract_from 'lib/POE/Component/Server/SimpleHTTP.pm';
 

Modified: branches/upstream/libpoe-component-server-simplehttp-perl/current/lib/POE/Component/Server/SimpleHTTP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-component-server-simplehttp-perl/current/lib/POE/Component/Server/SimpleHTTP.pm?rev=29136&op=diff
==============================================================================
--- branches/upstream/libpoe-component-server-simplehttp-perl/current/lib/POE/Component/Server/SimpleHTTP.pm (original)
+++ branches/upstream/libpoe-component-server-simplehttp-perl/current/lib/POE/Component/Server/SimpleHTTP.pm Thu Jan  1 22:18:18 2009
@@ -9,7 +9,7 @@
 
 # Initialize our version
 # $Revision: 1181 $
-$VERSION = '1.48';
+$VERSION = '1.50';
 
 # Import what we need from the POE namespace
 use POE;
@@ -83,12 +83,14 @@
 				# Force ourself to not use SSL
 				$SSLKEYCERT = undef;
 			}
-		} else {
+		} 
+		else {
 			if ( DEBUG ) {
 				warn 'The SSLKEYCERT option must be an array with exactly 2 elements in it!';
 			}
 		}
-	} else {
+	} 
+	else {
 		$SSLKEYCERT = undef;
 	}
 
@@ -102,7 +104,8 @@
 	if ( exists $opt{'PORT'} and defined $opt{'PORT'} and length( $opt{'PORT'} ) ) {
 		$PORT = $opt{'PORT'};
 		delete $opt{'PORT'};
-	} else {
+	} 
+	else {
 		croak( 'PORT is required to create a new POE::Component::Server::SimpleHTTP instance!' );
 	}
 
@@ -119,7 +122,8 @@
 	if ( exists $opt{'HOSTNAME'} and defined $opt{'HOSTNAME'} and length( $opt{'HOSTNAME'} ) ) {
 		$HOSTNAME = $opt{'HOSTNAME'};
 		delete $opt{'HOSTNAME'};
-	} else {
+	} 
+	else {
 		if ( DEBUG ) {
 			warn 'Using Sys::Hostname for HOSTNAME';
 		}
@@ -140,10 +144,12 @@
 		if ( ref $opt{'HEADERS'} and ref( $opt{'HEADERS'} ) eq 'HASH' ) {
 			$HEADERS = $opt{'HEADERS'};
 			delete $opt{'HEADERS'};
-		} else {
+		} 
+		else {
 			croak( 'HEADERS must be a reference to a HASH!' );
 		}
-	} else {
+	} 
+	else {
 		# Set to none
 		$HEADERS = {};
 
@@ -159,10 +165,12 @@
 		if ( ref $opt{'HANDLERS'} and ref( $opt{'HANDLERS'} ) eq 'ARRAY' ) {
 			$HANDLERS = $opt{'HANDLERS'};
 			delete $opt{'HANDLERS'};
-		} else {
+		} 
+		else {
 			croak( 'HANDLERS must be a reference to an ARRAY!' );
 		}
-	} else {
+	} 
+	else {
 		croak( 'HANDLERS is required to create a new POE::Component::Server::SimpleHTTP instance!' );
 	}
 
@@ -175,7 +183,8 @@
 			  unless $ERRORHANDLER->{'SESSION'};
 			croak( 'ERRORHANDLER does not have an EVENT attribute' )
 			  unless $ERRORHANDLER->{'EVENT'};
-		} else {
+		} 
+		else {
 			croak( 'ERRORHANDLER must be a reference to an HASH!' );
 		}
 	}
@@ -422,7 +431,8 @@
 	# Check if we should set up the wheel
 	if ( $_[HEAP]->{'RETRIES'} == MAX_RETRIES ) {
 		die 'POE::Component::Server::SimpleHTTP tried ' . MAX_RETRIES . ' times to create a Wheel and is giving up...';
-	} else {
+	} 
+	else {
 		# Increment the retry count if we did not get 'NOINC' as an argument
 		if ( ! defined $_[ARG0] ) {
 			# Increment the retries count
@@ -575,11 +585,13 @@
 			# Check for errors
 			if ( $@ ) {
 				croak( "HANDLER number $count has a malformed DIR -> $@" );
-			} else {
+			} 
+			else {
 				# Store it!
 				$handler->[ $count ]->{'RE'} = $regex;
 			}
-		} else {
+		} 
+		else {
 			croak( "HANDLER number $count is not a reference to a HASH!" );
 		}
 
@@ -706,7 +718,8 @@
 
 		# Set the path to an empty string
 		$path = '';
-	} else {
+	} 
+	else {
 		unless ( $_[HEAP]->{'PROXYMODE'} ) {
 			# Add stuff it needs!
 			my $uri = $request->uri;
@@ -750,7 +763,8 @@
 
 		# All done!
 		return;
-	} else {
+	} 
+	else {
 		# If we used SSL, turn on the flag!
 		if ( defined $_[HEAP]->{'SSLKEYCERT'} ) {
 			$response->{'CONNECTION'}->{'SSLified'} = 1;
@@ -797,7 +811,8 @@
 			'BadRequest (by POE::Filter::HTTPD)', $response->connection->remote_ip()
 		);
 		$_[KERNEL]->yield('DONE', $response);
-	} else {
+	} 
+	else {
 	   # Find which handler will handle this one
 		foreach my $handler ( @{ $_[HEAP]->{'HANDLERS'} } ) {
 			# Check if this matches
@@ -916,14 +931,14 @@
 # Got some sort of error from ReadWrite
 sub Got_Error {
 	# ARG0 = operation, ARG1 = error number, ARG2 = error string, ARG3 = wheel ID
-	my ( $operation, $errnum, $errstr, $id ) = @_[ ARG0 .. ARG3 ];
+   my ( $operation, $errnum, $errstr, $id ) = @_[ ARG0 .. ARG3 ];
 
 	# Only do this for non-EOF on read
-	unless ( $operation eq 'read' and $errnum == 0 ) {
+   unless ( $operation eq 'read' and $errnum == 0 ) {
 		# Debug stuff
-		if ( DEBUG ) {
-			warn "Wheel $id generated $operation error $errnum: $errstr\n";
-		}
+	if ( DEBUG ) {
+  	   warn "Wheel $id generated $operation error $errnum: $errstr\n";
+	}
 
         my $connection;
         if( $_[HEAP]->{'CONNECTIONS'}{ $id } ) {
@@ -940,10 +955,10 @@
 
 		# Mark the client dead
 		$connection->{'DIED'} = 1;
-	}
+   }
 
 	# Success!
-	return 1;
+   return 1;
 }
 
 # Output to the client!
@@ -971,11 +986,11 @@
 			warn 'Wheel disappeared, but the application sent us a DONE event, discarding it';
 		}
 
-      POE::Kernel->post(
-         $_[HEAP]->{ERRORHANDLER}->{SESSION},
-         $_[HEAP]->{ERRORHANDLER}->{EVENT},
-         'Wheel disappeared !'
-      );
+      		POE::Kernel->post(
+         		$_[HEAP]->{ERRORHANDLER}->{SESSION},
+         		$_[HEAP]->{ERRORHANDLER}->{EVENT},
+         		'Wheel disappeared !'
+      		);
 		# All done!
 		return 1;
 	}
@@ -992,11 +1007,11 @@
 		if ( DEBUG ) {
 			warn 'Tried to send data over a closed/nonexistant socket!';
 		}
-      POE::Kernel->post(
-         $_[HEAP]->{ERRORHANDLER}->{SESSION},
-         $_[HEAP]->{ERRORHANDLER}->{EVENT},
-         'Socket closed/nonexistant !'
-      );
+      		POE::Kernel->post(
+         		$_[HEAP]->{ERRORHANDLER}->{SESSION},
+         		$_[HEAP]->{ERRORHANDLER}->{EVENT},
+         		'Socket closed/nonexistant !'
+      		);
 		return;
 	}
 
@@ -1167,9 +1182,9 @@
     }
 
 	# Set the Content-Length if needed
-	if ( not $stream and not defined $response->header( 'Content-Length' )  ) {
+	if ( !$stream and ! defined $response->header( 'Content-Length' ) and my $len = length $response->content ) {
 		use bytes;
-		$response->header( 'Content-Length', length( $response->content ) );
+		$response->header( 'Content-Length', $len );
 	}
 
 	# Set the Content-Type if needed




More information about the Pkg-perl-cvs-commits mailing list