From 11c0310b0f3f3f3783f9aec73025c6fbd362b9bf Mon Sep 17 00:00:00 2001 From: djfiander Date: Tue, 24 Apr 2007 23:00:39 +0000 Subject: [PATCH] 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. --- SIPServer.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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); -- 2.11.0