From: djfiander Date: Tue, 24 Apr 2007 23:00:39 +0000 (+0000) Subject: Fix code so that it will run with Net::Server 0.96. This is just X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=11c0310b0f3f3f3783f9aec73025c6fbd362b9bf;p=working%2FSIPServer.git Fix code so that it will run with Net::Server 0.96. This is just eliminating a dependency on the internals of the Net::Server object, so this code will continue to run with older versions of Net::Server as well. --- diff --git a/SIPServer.pm b/SIPServer.pm index 9517c3e..85d5b46 100644 --- a/SIPServer.pm +++ b/SIPServer.pm @@ -6,6 +6,7 @@ use Exporter; use Sys::Syslog qw(syslog); use Net::Server::PreFork; use IO::Socket::INET; +use Socket; use Data::Dumper; # For debugging require UNIVERSAL::require; @@ -75,14 +76,16 @@ SIPServer->run(@parms); sub process_request { my $self = shift; my $service; + my $sockname; my ($sockaddr, $port, $proto); my $transport; $self->{config} = $config; - $sockaddr = $self->{server}->{sockaddr}; - $port = $self->{server}->{sockport}; - $proto = $self->{server}->{proto}; + $sockname = getsockname(STDIN); + ($port, $sockaddr) = sockaddr_in($sockname); + $sockaddr = inet_ntoa($sockaddr); + $proto = $self->{server}->{client}->NS_proto(); $self->{service} = $config->find_service($sockaddr, $port, $proto);