projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added some anti thrash code for crossing messages
[spider.git]
/
perl
/
DXChannel.pm
diff --git
a/perl/DXChannel.pm
b/perl/DXChannel.pm
index 2b4fda78a20bf554916139a28157b52d20621342..6495e7a7edde6ed7e9ff32ac5630e755d9053816 100644
(file)
--- a/
perl/DXChannel.pm
+++ b/
perl/DXChannel.pm
@@
-73,8
+73,25
@@
use vars qw(%channels %valid);
annfilter => '9,Announce Filter',
wwvfilter => '9,WWV Filter',
spotfilter => '9,Spot Filter',
annfilter => '9,Announce Filter',
wwvfilter => '9,WWV Filter',
spotfilter => '9,Spot Filter',
+ passwd => '9,Passwd List,parray',
);
);
+# object destruction
+sub DESTROY
+{
+ my $self = shift;
+ undef $self->{user};
+ undef $self->{conn};
+ undef $self->{loc};
+ undef $self->{pagedata};
+ undef $self->{group};
+ undef $self->{delayed};
+ undef $self->{annfilter};
+ undef $self->{wwvfilter};
+ undef $self->{spotfilter};
+ undef $self->{passwd};
+}
+
# create a new channel object [$obj = DXChannel->new($call, $msg_conn_obj, $user_obj)]
sub alloc
{
# create a new channel object [$obj = DXChannel->new($call, $msg_conn_obj, $user_obj)]
sub alloc
{
@@
-83,6
+100,7
@@
sub alloc
die "trying to create a duplicate channel for $call" if $channels{$call};
$self->{call} = $call;
die "trying to create a duplicate channel for $call" if $channels{$call};
$self->{call} = $call;
+ $self->{priv} = 0;
$self->{conn} = $conn if defined $conn; # if this isn't defined then it must be a list
if (defined $user) {
$self->{user} = $user;
$self->{conn} = $conn if defined $conn; # if this isn't defined then it must be a list
if (defined $user) {
$self->{user} = $user;
@@
-210,7
+228,7
@@
sub msg
return DXM::msg($self->{lang}, @_);
}
return DXM::msg($self->{lang}, @_);
}
-# stick a broadcast on the delayed queue
+# stick a broadcast on the delayed queue
(but only up to 20 items)
sub delay
{
my $self = shift;
sub delay
{
my $self = shift;
@@
-218,6
+236,9
@@
sub delay
$self->{delayed} = [] unless $self->{delayed};
push @{$self->{delayed}}, $s;
$self->{delayed} = [] unless $self->{delayed};
push @{$self->{delayed}}, $s;
+ if (@{$self->{delayed}} >= 20) {
+ shift @{$self->{delayed}}; # lose oldest one
+ }
}
# change the state of the channel - lots of scope for debugging here :-)
}
# change the state of the channel - lots of scope for debugging here :-)
@@
-232,9
+253,7
@@
sub state
# if there is any queued up broadcasts then splurge them out here
if ($self->{delayed} && ($self->{state} eq 'prompt' || $self->{state} eq 'convers')) {
# if there is any queued up broadcasts then splurge them out here
if ($self->{delayed} && ($self->{state} eq 'prompt' || $self->{state} eq 'convers')) {
- for (@{$self->{delayed}}) {
- $self->send($_);
- }
+ $self->send (@{$self->{delayed}});
delete $self->{delayed};
}
}
delete $self->{delayed};
}
}