From a475404d1ffa082435078a1e29fea2445c2cdf6b Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 9 May 2014 17:49:11 +0200 Subject: [PATCH] Fix #5474 Good port choosen --- apps/apache/serverstatus/mode/requests.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/apache/serverstatus/mode/requests.pm b/apps/apache/serverstatus/mode/requests.pm index 2b74dab7a..f6d2fc7ba 100644 --- a/apps/apache/serverstatus/mode/requests.pm +++ b/apps/apache/serverstatus/mode/requests.pm @@ -108,6 +108,13 @@ sub check_options { $self->{output}->option_exit(); } + $self->{cache_port} = ''; + if (defined($self->{option_results}->{port}) && $self->{option_results}->{port} ne '') { + $self->{cache_port} = $self->{option_results}->{port}; + } else { + $self->{cache_port} = 80 if ($self->{option_results}->{proto} eq 'http'); + $self->{cache_port} = 443 if ($self->{option_results}->{proto} eq 'https'); + } $self->{statefile_value}->check_options(%options); } @@ -130,7 +137,7 @@ sub run { } $rPerSec = '0' . $rPerSec if ($rPerSec =~ /^\./); - $self->{statefile_value}->read(statefile => 'apache_' . $self->{option_results}->{hostname} . '_' . $self->{option_results}->{port} . '_' . $self->{mode}); + $self->{statefile_value}->read(statefile => 'apache_' . $self->{option_results}->{hostname} . '_' . $self->{cache_port} . '_' . $self->{mode}); my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp'); my $old_total_access = $self->{statefile_value}->get(name => 'total_access'); my $old_total_bytes = $self->{statefile_value}->get(name => 'total_bytes');