/[cwmp]/google/trunk/lib/CWMP/Store.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/Store.pm

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

revision 162 by dpavlin, Sat Oct 27 22:55:45 2007 UTC revision 172 by dpavlin, Sun Oct 28 15:43:07 2007 UTC
# Line 46  sub new { Line 46  sub new {
46    
47          $self->current_store->open( @_ );          $self->current_store->open( @_ );
48    
49            # so that we don't have to check if it's defined
50            $self->debug( 0 ) unless $self->debug;
51    
52          return $self;          return $self;
53  }  }
54    
# Line 63  sub current_store { Line 66  sub current_store {
66    
67          confess "unknown store module $module not one of ", dump( $self->possible_stores ) unless $s;          confess "unknown store module $module not one of ", dump( $self->possible_stores ) unless $s;
68    
69          warn "## current store = $s\n" if $self->debug;  #       warn "#### current store = $s\n" if $self->debug > 4;
70    
71          return $s;          return $s;
72  }  }
# Line 84  sub update_state { Line 87  sub update_state {
87          confess "need $k value" unless $v;          confess "need $k value" unless $v;
88          confess "need state" unless $state;          confess "need state" unless $state;
89    
90          warn "## update_state( $k => $v, ", dump( $state ), " )\n" if $self->debug;          warn "#### update_state( $k => $v, ", dump( $state ), " )\n" if $self->debug > 4;
91    
92          my $uid;          my $uid;
93    
# Line 117  sub get_state { Line 120  sub get_state {
120          confess "need ID or uid" unless $k =~ m/^(ID|uid)$/;          confess "need ID or uid" unless $k =~ m/^(ID|uid)$/;
121          confess "need $k value" unless $v;          confess "need $k value" unless $v;
122    
123          warn "## get_state( $k => $v )\n" if $self->debug;          warn "#### get_state( $k => $v )\n" if $self->debug > 4;
124    
125          my $uid;          my $uid;
126    
# Line 166  sub ID_to_uid { Line 169  sub ID_to_uid {
169    
170          confess "need ID" unless $ID;          confess "need ID" unless $ID;
171    
172          warn "ID_to_uid",dump( $ID, $state ),$/ if $self->debug;          warn "#### ID_to_uid",dump( $ID, $state ),$/ if $self->debug > 4;
173    
174          $session->{ $ID }->{last_seen} = time();          $session->{ $ID }->{last_seen} = time();
175    
# Line 183  sub ID_to_uid { Line 186  sub ID_to_uid {
186                  return $uid;                  return $uid;
187          } else {          } else {
188                  warn "## can't find uid for ID $ID, first seen?\n";                  warn "## can't find uid for ID $ID, first seen?\n";
                 return;  
189          }          }
190    
191          # TODO: expire sessions longer than 30m          # TODO: expire sessions longer than 30m
192    
         warn "current session = ",dump( $session );  
   
193          return;          return;
194  }  }
195    

Legend:
Removed from v.162  
changed lines
  Added in v.172

  ViewVC Help
Powered by ViewVC 1.1.26