--- googlecode.com/svn/trunk/Meteor/Subscriber.pm 2007/12/20 21:24:24 32 +++ googlecode.com/svn/trunk/Meteor/Subscriber.pm 2008/02/03 23:53:55 44 @@ -44,6 +44,7 @@ our %PersistentConnections=(); our $NumAcceptedConnections=0; + ############################################################################### # Factory methods @@ -79,7 +80,7 @@ if(exists($PersistentConnections{$id})) { - $PersistentConnections{$id}->close(1); + $PersistentConnections{$id}->close(); } } @@ -152,17 +153,15 @@ my $channels={}; my $channelName; my $offset; - foreach my $chandef (@channelData) - { - if($chandef=~/^([a-z0-9]+)(.(r|b|h)([0-9]*))?$/) - { + foreach my $chandef (@channelData) { + if($chandef=~/^([a-z0-9]+)(.(r|b|h)([0-9]*))?$/i) { $channelName = $1; $channels->{$channelName}->{'startIndex'} = undef; - for ($3) { - $offset = $4; - /r/ && do { $channels->{$channelName}->{'startIndex'} = $offset; last; }; - /b/ && do { $channels->{$channelName}->{'startIndex'} = -$offset; last; }; - /h/ && do { $channels->{$channelName}->{'startIndex'} = 0; last; }; + if ($3) { + $offset = $4; + if ($3 eq 'r') { $channels->{$channelName}->{'startIndex'} = $offset; } + if ($3 eq 'b') { $channels->{$channelName}->{'startIndex'} = -$offset; } + if ($3 eq 'h') { $channels->{$channelName}->{'startIndex'} = 0; } } } } @@ -345,11 +344,14 @@ } } - $::Statistics->{'current_subscribers'}--; - $self->SUPER::close(); } +sub didClose { + + $::Statistics->{'current_subscribers'}--; +} + sub checkForMaxTime { my $self=shift; my $time=shift;