From: Dobrica Pavlinusic Date: Sat, 27 Oct 2007 22:53:22 +0000 (+0000) Subject: r135@llin (orig r134): dpavlin | 2007-10-26 22:49:13 +0200 X-Git-Url: http://git.rot13.org/?p=perl-cwmp.git;a=commitdiff_plain;h=acf749f488794b1234814fe3d04f69d350d1a133;hp=5ebc558e04103b5e58c76ec085bf3fedc77f53a1 r135@llin (orig r134): dpavlin | 2007-10-26 22:49:13 +0200 forgoten Module::Pluggable git-svn-id: https://perl-cwmp.googlecode.com/svn/trunk@150 836a5e1a-633d-0410-964b-294494ad4392 --- diff --git a/Makefile.PL b/Makefile.PL index 68a498d..907131d 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -28,4 +28,3 @@ clean_files('dump/*'); auto_install; WriteAll; - diff --git a/lib/CWMP/Response.pm b/lib/CWMP/Response.pm index 6b2a866..10303b2 100644 --- a/lib/CWMP/Response.pm +++ b/lib/CWMP/Response.pm @@ -101,6 +101,27 @@ sub GetParameterNames { }); } +=head2 GetParameterValues { + + $response->GetParameterValues( $state, $ParameterPath, $NextLevel ); + +=cut + +sub GetParameterValues { + my ( $self, $state, $ParameterPath, $NextLevel ) = @_; + $ParameterPath ||= ''; # all + $NextLevel ||= 0; # all + warn "# GetParameterValues( '$ParameterPath', $NextLevel )\n" if $self->debug; + $self->xml( $state, sub { + my ( $X, $state ) = @_; + + $X->GetParameterValues( $cwmp, + $X->ParameterPath( $cwmp, $ParameterPath ), + $X->NextLevel( $cwmp, $NextLevel ), + ); + }); +} + =head2 xml Used to implement methods which modify just body of soap message. diff --git a/lib/CWMP/Server.pm b/lib/CWMP/Server.pm index 381e255..7634806 100644 --- a/lib/CWMP/Server.pm +++ b/lib/CWMP/Server.pm @@ -137,15 +137,21 @@ sub process_request { warn "default CPE queue ( " . join(",",@{$prop->{default_queue}}) . " )\n" if defined($prop->{default_queue}); - my $session = CWMP::Session->new({ - sock => $sock, - queue => $prop->{default_queue}, - store => $prop->{store}, - debug => $prop->{debug}, - }) || confess "can't create session"; - - while ( $session->process_request ) { - warn "...another one bites the dust...\n"; + eval { + my $session = CWMP::Session->new({ + sock => $sock, + queue => $prop->{default_queue}, + store => $prop->{store}, + debug => $prop->{debug}, + }) || confess "can't create session"; + + while ( $session->process_request ) { + warn "...another one bites the dust...\n"; + } + }; + + if ($@) { + warn $@; } warn "...returning to accepting new connections\n";