CGreenhill <[EMAIL PROTECTED]> writes:

>       Is there a quick way to get a servers ip from a request? I've used 
> $ip = $req->header("Client-Peer") before, but that header isn't always
> present.

By popular demand, it will come back in the next release.  If you
can't wait apply the following patch:

Index: lib/LWP/Protocol/http.pm
===================================================================
RCS file: /cvsroot/libwww-perl/lwp5/lib/LWP/Protocol/http.pm,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -p -u -r1.63 -r1.64
--- lib/LWP/Protocol/http.pm    14 Dec 2001 19:33:52 -0000      1.63
+++ lib/LWP/Protocol/http.pm    20 Sep 2002 14:53:30 -0000      1.64
@@ -1,4 +1,4 @@
-# $Id: http.pm,v 1.63 2001/12/14 19:33:52 gisle Exp $
+# $Id: http.pm,v 1.64 2002/09/20 14:53:30 gisle Exp $
 #

 package LWP::Protocol::http;
@@ -72,9 +72,9 @@ sub _check_sock
 sub _get_sock_info
 {
     my($self, $res, $sock) = @_;
-    #if (defined(my $peerhost = $sock->peerhost)) {
-    #    $res->header("Client-Peer" => "$peerhost:" . $sock->peerport);
-    #}
+    if (defined(my $peerhost = $sock->peerhost)) {
+        $res->header("Client-Peer" => "$peerhost:" . $sock->peerport);
+    }
 }

 sub _fixup_header

Regards,
Gisle

Reply via email to