From: djfiander Date: Fri, 6 Apr 2007 20:49:06 +0000 (+0000) Subject: Apply Bill Erickson's patch to clean up matching an incoming X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2e131b3106796165a0ea1cc050c9ce22bc96bcdf;p=working%2FSIPServer.git Apply Bill Erickson's patch to clean up matching an incoming connection against the configuration file. There's no longer a special case for 127.0.0.1, so it will not longer match 'localhost', but it doesn't match any other hostnames anyway. --- diff --git a/Sip/Configuration.pm b/Sip/Configuration.pm index 1c4e259..5b1ddb1 100644 --- a/Sip/Configuration.pm +++ b/Sip/Configuration.pm @@ -63,15 +63,10 @@ sub find_service { my ($self, $sockaddr, $port, $proto) = @_; my $portstr; - if ($sockaddr eq '127.0.0.1') { - foreach my $addr ('', '*:', 'localhost:', '127.0.0.1:') { - $portstr = sprintf("%s%s/%s", $addr, $port, $proto); - Sys::Syslog::syslog("LOG_DEBUG", "Configuration::find_service: Trying $portstr"); - last if (exists(($self->{listeners})->{$portstr})); - } - } else { - $portstr = sprintf("%s:%s/%s", $sockaddr, $port, $proto); + foreach my $addr ('', '*:', "$sockaddr:") { + $portstr = sprintf("%s%s/%s", $addr, $port, $proto); Sys::Syslog::syslog("LOG_DEBUG", "Configuration::find_service: Trying $portstr"); + last if (exists(($self->{listeners})->{$portstr})); } return $self->{listeners}->{$portstr};