mirror of
https://github.com/mirror/wget.git
synced 2026-08-19 09:23:27 +08:00
Don't use hardcoded ports.
This commit is contained in:
@@ -30,17 +30,26 @@ my $VERSION = 0.01;
|
||||
}
|
||||
|
||||
|
||||
sub _setup_server {}
|
||||
sub _setup_server {
|
||||
my $self = shift;
|
||||
$self->{_server} = HTTPServer->new (LocalAddr => 'localhost',
|
||||
ReuseAddr => 1)
|
||||
or die "Cannot create server!!!";
|
||||
}
|
||||
|
||||
|
||||
sub _launch_server {
|
||||
my $self = shift;
|
||||
my $synch_func = shift;
|
||||
|
||||
my $server = HTTPServer->new (LocalAddr => 'localhost',
|
||||
LocalPort => '8080',
|
||||
ReuseAddr => 1) or die "Cannot create server!!!";
|
||||
$server->run ($self->{_input}, $synch_func);
|
||||
$self->{_server}->run ($self->{_input}, $synch_func);
|
||||
}
|
||||
|
||||
sub _substitute_port {
|
||||
my $self = shift;
|
||||
my $ret = shift;
|
||||
$ret =~ s/{{port}}/$self->{_server}->sockport/eg;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user