[Catalyst-commits] r8667 - in Catalyst-Runtime/5.80/trunk: .
lib/Catalyst lib/Catalyst/Engine
marcus at dev.catalyst.perl.org
marcus at dev.catalyst.perl.org
Sun Nov 30 21:55:56 GMT 2008
Author: marcus
Date: 2008-11-30 21:55:55 +0000 (Sun, 30 Nov 2008)
New Revision: 8667
Modified:
Catalyst-Runtime/5.80/trunk/Changes
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm
Log:
Lazy resolution of hostname
Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes 2008-11-30 00:29:57 UTC (rev 8666)
+++ Catalyst-Runtime/5.80/trunk/Changes 2008-11-30 21:55:55 UTC (rev 8667)
@@ -1,5 +1,6 @@
# This file documents the revision history for Perl extension Catalyst.
+ - Make hostname resolution lazy (Marc Mims)
- Support mocking virtualhosts in test suite (Jason Gottshall)
- Add README
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm 2008-11-30 00:29:57 UTC (rev 8666)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm 2008-11-30 21:55:55 UTC (rev 8667)
@@ -70,7 +70,7 @@
$request->address($ip);
}
- $request->hostname( $ENV{REMOTE_HOST} );
+ $request->hostname( $ENV{REMOTE_HOST} ) if exists $ENV{REMOTE_HOST};
$request->protocol( $ENV{SERVER_PROTOCOL} );
$request->user( $ENV{REMOTE_USER} );
$request->method( $ENV{REQUEST_METHOD} );
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP.pm 2008-11-30 00:29:57 UTC (rev 8666)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP.pm 2008-11-30 21:55:55 UTC (rev 8667)
@@ -359,7 +359,6 @@
PATH_INFO => $path || '',
QUERY_STRING => $query_string || '',
REMOTE_ADDR => $sockdata->{peeraddr},
- REMOTE_HOST => $sockdata->{peername},
REQUEST_METHOD => $method || '',
SERVER_NAME => $sockdata->{localname},
SERVER_PORT => $port,
@@ -510,9 +509,6 @@
# This mess is necessary to keep IE from crashing the server
my $data = {
- peername => $iaddr
- ? ( gethostbyaddr( $iaddr, AF_INET ) || 'localhost' )
- : 'localhost',
peeraddr => $iaddr
? ( inet_ntoa($iaddr) || '127.0.0.1' )
: '127.0.0.1',
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm 2008-11-30 00:29:57 UTC (rev 8666)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm 2008-11-30 21:55:55 UTC (rev 8667)
@@ -113,7 +113,7 @@
lazy => 1,
default => sub {
my ($self) = @_;
- gethostbyaddr( inet_aton( $self->address ), AF_INET )
+ gethostbyaddr( inet_aton( $self->address ), AF_INET ) || 'localhost'
},
);
More information about the Catalyst-commits
mailing list