X-Git-Url: http://git.rot13.org/?p=perl-cwmp.git;a=blobdiff_plain;f=lib%2FCWMP%2FServer.pm;fp=lib%2FCWMP%2FServer.pm;h=51a520a4b154695715d92e6e42cb05f7a01f0d94;hp=0a67293b037f5645141c9493b6644af5f211585e;hb=b1f0ff50033a9e8f2fbc75828452baa41ff83608;hpb=581d876052dcb22f98f52858860e6e999ca1d08a diff --git a/lib/CWMP/Server.pm b/lib/CWMP/Server.pm index 0a67293..51a520a 100644 --- a/lib/CWMP/Server.pm +++ b/lib/CWMP/Server.pm @@ -136,15 +136,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_path => $prop->{store_path}, - 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_path => $prop->{store_path}, + 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";