/[cwmp]/google/trunk/lib/CWMP/Session.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /google/trunk/lib/CWMP/Session.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 197 by dpavlin, Mon Nov 12 22:03:01 2007 UTC revision 198 by dpavlin, Mon Nov 12 22:13:59 2007 UTC
# Line 149  sub process_request { Line 149  sub process_request {
149    
150          $sock->send( "Set-Cookie: ID=" . $state->{ID} . "; path=/\r\n" ) if ( $state->{ID} );          $sock->send( "Set-Cookie: ID=" . $state->{ID} . "; path=/\r\n" ) if ( $state->{ID} );
151    
152            my $uid = $self->store->ID_to_uid( $state->{ID}, $state );
153    
154          my $queue = CWMP::Queue->new({          my $queue = CWMP::Queue->new({
155                  id => $self->store->ID_to_uid( $state->{ID}, $state ),                  id => $uid,
156                  debug => $self->debug,                  debug => $self->debug,
157          });          });
158          my $job;          my $job;
# Line 161  sub process_request { Line 163  sub process_request {
163          } elsif ( $job = $queue->dequeue ) {          } elsif ( $job = $queue->dequeue ) {
164                  $xml = $self->dispatch( $job->dispatch );                  $xml = $self->dispatch( $job->dispatch );
165          } elsif ( $size == 0 ) {          } elsif ( $size == 0 ) {
166                  warn ">>> no more queued commands, closing connection\n";                  warn ">>> no more queued commands, closing connection to $uid\n";
167                  return 0;                  return 0;
168          } else {          } else {
169                  warn ">>> empty response\n";                  warn ">>> empty response to $uid\n";
170                  $state->{NoMoreRequests} = 1;                  $state->{NoMoreRequests} = 1;
171                  $xml = $self->dispatch( 'xml', sub {} );                  $xml = $self->dispatch( 'xml', sub {} );
172          }          }
# Line 172  sub process_request { Line 174  sub process_request {
174          $sock->send( "Content-Length: " . length( $xml ) . "\r\n\r\n" );          $sock->send( "Content-Length: " . length( $xml ) . "\r\n\r\n" );
175          $sock->send( $xml ) or die "can't send response";          $sock->send( $xml ) or die "can't send response";
176    
177          warn ">>>> " . $sock->peerhost . " [" . localtime() . "] sent ", length( $xml )," bytes\n";          warn ">>>> " . $sock->peerhost . " [" . localtime() . "] sent ", length( $xml )," bytes to $uid\n";
178    
179          $job->finish if $job;          $job->finish if $job;
180          warn "### request over\n" if $self->debug;          warn "### request over for $uid\n" if $self->debug;
181    
182          return 1;       # next request          return 1;       # next request
183  };  };

Legend:
Removed from v.197  
changed lines
  Added in v.198

  ViewVC Help
Powered by ViewVC 1.1.26