stas 2002/08/15 01:44:26 Modified: lib/Apache compat.pm t/response/TestCompat compat2.pm Log: $r->get_remote_host() compat wrapper ala mod_perl 1.0 + tests Revision Changes Path 1.65 +5 -1 modperl-2.0/lib/Apache/compat.pm Index: compat.pm =================================================================== RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- compat.pm 31 Jul 2002 16:32:40 -0000 1.64 +++ compat.pm 15 Aug 2002 08:44:26 -0000 1.65 @@ -127,6 +127,8 @@ package Apache::RequestRec; +use Apache::Const -compile => qw(REMOTE_NAME); + #no longer exist in 2.0 sub soft_timeout {} sub hard_timeout {} @@ -201,7 +203,9 @@ } sub get_remote_host { - shift->connection->remote_host(@_); + my($r, $type) = @_; + $type = Apache::REMOTE_NAME unless defined $type; + $r->connection->get_remote_host($type, $r->dir_config); } sub parse_args { 1.2 +3 -2 modperl-2.0/t/response/TestCompat/compat2.pm Index: compat2.pm =================================================================== RCS file: /home/cvs/modperl-2.0/t/response/TestCompat/compat2.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- compat2.pm 14 Aug 2002 15:12:55 -0000 1.1 +++ compat2.pm 15 Aug 2002 08:44:26 -0000 1.2 @@ -10,7 +10,7 @@ use Apache::Test; use Apache::compat (); -use Apache::Constants qw(OK); +use Apache::Constants qw(OK REMOTE_HOST); my %string_size = ( '-1' => " -", @@ -24,7 +24,7 @@ sub handler { my $r = shift; - plan $r, tests => 51; + plan $r, tests => 52; $r->send_http_header('text/plain'); @@ -195,6 +195,7 @@ # $r->get_remote_host ok $r->get_remote_host() || 1; + ok $r->get_remote_host(Apache::REMOTE_HOST) || 1; # Apache::Util::size_string {