[Bps-public-commit] HTTP-Server-Simple branch, master, updated. 0.42_01-1-g20bc6e3

Jesse Vincent jesse at bestpractical.com
Sat May 1 10:33:03 EDT 2010


The branch, master has been updated
       via  20bc6e3b8571553a166b356a267b53782796eca3 (commit)
      from  0fa157eb2cf44c6f753b582a43937300a0af4eb4 (commit)

Summary of changes:
 Changes                                   |    4 ++++
 lib/HTTP/Server/Simple.pm                 |    4 +++-
 lib/HTTP/Server/Simple/CGI/Environment.pm |    1 +
 3 files changed, 8 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 20bc6e3b8571553a166b356a267b53782796eca3
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sat May 1 22:25:03 2010 +0800

    Support for REMOTE_PORT

diff --git a/Changes b/Changes
index d3f53c2..7e148e2 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+0.43 Sat May  1 22:23:55 CST 2010
+
+* Support for getting REMOTE_PORT -- rgs
+
 0.42_01 Fri Apr  2 12:59:48 EDT 2010
 
 * Patch to t/01live.t to prevent spurious win32 test failures.
diff --git a/lib/HTTP/Server/Simple.pm b/lib/HTTP/Server/Simple.pm
index b7e1f97..01df864 100644
--- a/lib/HTTP/Server/Simple.pm
+++ b/lib/HTTP/Server/Simple.pm
@@ -359,7 +359,7 @@ sub _process_request {
         # ( http://dev.catalyst.perl.org/changeset/5195, 5221 )
         
         my $remote_sockaddr = getpeername( $self->stdio_handle );
-        my ( undef, $iaddr ) = $remote_sockaddr ? sockaddr_in($remote_sockaddr) : (undef,undef);
+        my ( $iport, $iaddr ) = $remote_sockaddr ? sockaddr_in($remote_sockaddr) : (undef,undef);
         my $peeraddr = $iaddr ? ( inet_ntoa($iaddr) || "127.0.0.1" ) : '127.0.0.1';
         
         my ( $method, $request_uri, $proto ) = $self->parse_request;
@@ -384,6 +384,7 @@ sub _process_request {
             localport    => $self->port,
             peername     => $peeraddr,
             peeraddr     => $peeraddr,
+            peerport     => $iport,
         );
 
         # HTTP/0.9 didn't have any headers (I think)
@@ -486,6 +487,7 @@ of keys of this list.
   port         Received Port         80, 8080
   peername     Remote name           "200.2.4.5", "foo.com"
   peeraddr     Remote address        "200.2.4.5", "::1"
+  peerport     Remote port           42424
   localname    Local interface       "localhost", "myhost.com"
 
 =cut
diff --git a/lib/HTTP/Server/Simple/CGI/Environment.pm b/lib/HTTP/Server/Simple/CGI/Environment.pm
index df7e6e4..98e3157 100644
--- a/lib/HTTP/Server/Simple/CGI/Environment.pm
+++ b/lib/HTTP/Server/Simple/CGI/Environment.pm
@@ -66,6 +66,7 @@ See the docs in L<HTTP::Server::Simple> for more detail.
     method       => "REQUEST_METHOD",
     peeraddr     => "REMOTE_ADDR",
     peername     => "REMOTE_HOST",
+    peerport     => "REMOTE_PORT",
     query_string => "QUERY_STRING",
 );
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list