Philip M. Gollucci wrote:
In mp2 I am doing this:
-----------------------
use Apache2::ServerRec ();
use Apache2::ServerUtil ();
my $s = Apache2::ServerUtil->server();
warn "port = ",$s->port(),"\n";
Try
use Apache2::RequestUtil ();
Apache2::RequestUtil->request()->get_server_port()
Though I don't see why your method doesn't work. I'll give it a spin in
a bit.
Okay, I'll verify that neither method works from startup.pl whether I pull it
in via
PerlRequire or PerlPostConfigRequire.
I will say that the following handler gives me mixed Results:
package TEST::Port;
use strict;
use warnings FATAL => 'all';
use Carp;
use Apache2::RequestUtil ();
use Apache2::ServerUtil ();
use Apache2::Const -compile => qw (OK);
sub handler {
my $r = shift;
$r->content_type('text/html');
my $s = $r->server();
my $port1 = $s->port();
my $port2 = $r->get_server_port();
my $port3 = Apache2::ServerUtil->server()->port();
$r->print("Ports: $port1, $port2, $port3 <br />\n");
return Apache2::Const::OK;
}
Gives me:
Ports: 0, 8000, 0
I checked in httpd/server/core.c:ap_get_server_port() via gdb and yes,
it does return 8000. So that verifies #2 works.
As far as I can tell 1, 3 don't come through this function.. but I can't for
the life of me figure out where the hell
they do go. Any ideas?
I also can't see where $s->port() is tested in the test suite. Only
$r->get_server_port is which works :)
I would assume the end up calling the same function though.
--
END
------------------------------------------------------------
What doesn't kill us can only make us stronger.
Nothing is impossible.
Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
http://www.liquidityservicesinc.com
http://www.liquidation.com
http://www.uksurplus.com
http://www.govliquidation.com
http://www.gowholesale.com