X-Git-Url: http://git.rot13.org/?p=perl-cwmp.git;a=blobdiff_plain;f=lib%2FCWMP%2FSession.pm;h=cf11c30d57cb8d1e45bbe02c5436cf870242873a;hp=488bd4f45e5fb36c06667f9e6e2529a46fbf03f9;hb=e693a253b860bfaba1373b19d470cbf84210c8c9;hpb=fec1acf5d1dfce1a661535d2b40b0e9d97de6005 diff --git a/lib/CWMP/Session.pm b/lib/CWMP/Session.pm index 488bd4f..cf11c30 100644 --- a/lib/CWMP/Session.pm +++ b/lib/CWMP/Session.pm @@ -149,8 +149,10 @@ sub process_request { $sock->send( "Set-Cookie: ID=" . $state->{ID} . "; path=/\r\n" ) if ( $state->{ID} ); + my $uid = $self->store->ID_to_uid( $state->{ID}, $state ); + my $queue = CWMP::Queue->new({ - id => $self->store->ID_to_uid( $state->{ID}, $state ), + id => $uid, debug => $self->debug, }); my $job; @@ -161,10 +163,10 @@ sub process_request { } elsif ( $job = $queue->dequeue ) { $xml = $self->dispatch( $job->dispatch ); } elsif ( $size == 0 ) { - warn ">>> no more queued commands, closing connection\n"; + warn ">>> no more queued commands, closing connection to $uid\n"; return 0; } else { - warn ">>> empty response\n"; + warn ">>> empty response to $uid\n"; $state->{NoMoreRequests} = 1; $xml = $self->dispatch( 'xml', sub {} ); } @@ -172,10 +174,10 @@ sub process_request { $sock->send( "Content-Length: " . length( $xml ) . "\r\n\r\n" ); $sock->send( $xml ) or die "can't send response"; - warn ">>>> " . $sock->peerhost . " [" . localtime() . "] sent ", length( $xml )," bytes\n"; + warn ">>>> " . $sock->peerhost . " [" . localtime() . "] sent ", length( $xml )," bytes to $uid\n"; $job->finish if $job; - warn "### request over\n" if $self->debug; + warn "### request over for $uid\n" if $self->debug; return 1; # next request };