/[meteor]/googlecode.com/svn/trunk/Meteor/Subscriber.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 /googlecode.com/svn/trunk/Meteor/Subscriber.pm

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

revision 62 by andrew.betts, Thu Nov 27 00:33:21 2008 UTC revision 64 by andrew.betts, Mon Jan 19 11:19:41 2009 UTC
# Line 57  sub newFromServer { Line 57  sub newFromServer {
57          $self->{'headerBuffer'}='';          $self->{'headerBuffer'}='';
58          $self->{'messageCount'}=0;          $self->{'messageCount'}=0;
59                    
         my $maxTime=$::CONF{'MaxTime'};  
         if($maxTime>0)  
         {  
                 $self->{'connectionTimeLimit'}=$self->{'connectionStart'}+$maxTime;  
         }  
           
60          $::Statistics->{'current_subscribers'}++;          $::Statistics->{'current_subscribers'}++;
61          $::Statistics->{'subscriber_connections_accepted'}++;          $::Statistics->{'subscriber_connections_accepted'}++;
62                    
# Line 201  sub processLine { Line 195  sub processLine {
195                                          my $startIndex=$channels->{$channelName}->{'startIndex'};                                          my $startIndex=$channels->{$channelName}->{'startIndex'};
196                                          $self->{'channels'}->{$channelName}->addSubscriber($self,$startIndex,$persist,$self->{'mode'},$self->{'useragent'});                                          $self->{'channels'}->{$channelName}->addSubscriber($self,$startIndex,$persist,$self->{'mode'},$self->{'useragent'});
197                                  }                                  }
198                                  delete ($self->{'channels'}) unless($persist);                                  if (!$persist) {
199                                  $self->close(1, 'responseComplete') unless($persist);                                          delete ($self->{'channels'});
200                                  $self->close(1, 'closedOnEvent') unless($self->{'messageCount'} == 0);                                          $self->close(1, 'responseComplete');
201                                    }
202                                  delete($self->{'headerBuffer'});                                  delete($self->{'headerBuffer'});
203    
204                                    # If long polling, close connection immediately if any messages have been sent
205                                    if ($self->{'messageCount'} > 0 && $self->{'mode'} eq 'longpoll') {
206                                            $self->close(1, 'closedOnEvent');
207                                    }
208                                  return;                                  return;
209                          }                          }
210                  }                  }
# Line 218  sub processLine { Line 218  sub processLine {
218                  elsif($self->{'headerBuffer'}=~/GET\s+([^\s\?]+)/)                  elsif($self->{'headerBuffer'}=~/GET\s+([^\s\?]+)/)
219                  {                  {
220                          Meteor::Document->serveFileToClient($1,$self);                          Meteor::Document->serveFileToClient($1,$self);
221                          $self->close(1, 'responseComplete');                          $self->SUPER::close();
222                          return;                          return;
223                  }                  }
224                                    
# Line 377  sub getConf { Line 377  sub getConf {
377          my $self=shift;          my $self=shift;
378          my $key=shift;          my $key=shift;
379                    
380          if(exists($self->{'mode'}) && $self->{'mode'} ne '')          if(exists($self->{'mode'}) && $self->{'mode'} ne '') {
381          {                  my $k=$key.$self->{'mode'};            
                 my $k=$key.$self->{'mode'};  
                   
382                  if(exists($::CONF{$k})) {                  if(exists($::CONF{$k})) {
383                          return $::CONF{$k};                          return $::CONF{$k};
384                  }                  }

Legend:
Removed from v.62  
changed lines
  Added in v.64

  ViewVC Help
Powered by ViewVC 1.1.26