projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chop out Investigate code
[spider.git]
/
perl
/
DXMsg.pm
diff --git
a/perl/DXMsg.pm
b/perl/DXMsg.pm
index 04ef99cb8ecffccfb21d7215b590a886497d2a8d..5190b6b6cc49dd3ac5e9b1e66eeb2efa85e04616 100644
(file)
--- a/
perl/DXMsg.pm
+++ b/
perl/DXMsg.pm
@@
-33,10
+33,8
@@
eval {
use strict;
use vars qw($VERSION $BRANCH);
use strict;
use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+
+main::mkver($VERSION = q$Revision$);
use vars qw(%work @msg $msgdir %valid %busy $maxage $last_clean $residencetime
@badmsg @swop $swopfn $badmsgfn $forwardfn @forward $timeout $waittime
use vars qw(%work @msg $msgdir %valid %busy $maxage $last_clean $residencetime
@badmsg @swop $swopfn $badmsgfn $forwardfn @forward $timeout $waittime
@@
-151,7
+149,10
@@
sub process
}
# clean the message queue
}
# clean the message queue
- clean_old() if $main::systime - $last_clean > 3600 ;
+ if ($main::systime >= $last_clean+3600) {
+ clean_old();
+ $last_clean = $main::systime;
+ }
# actual remove all the 'deleted' messages in one hit.
# this has to be delayed until here otherwise it only does one at
# actual remove all the 'deleted' messages in one hit.
# this has to be delayed until here otherwise it only does one at
@@
-161,7
+162,6
@@
sub process
$_->del_msg;
}
$_->del_msg;
}
- $last_clean = $main::systime;
}
# incoming message
}
# incoming message
@@
-312,6
+312,14
@@
sub handle_32
$ref->store($ref->{lines});
} else {
$ref->store($ref->{lines});
} else {
+ # is it too old
+ if ($ref->{t}+$maxage < $main::systime ) {
+ $ref->stop_msg($fromnode);
+ dbg("old message from $ref->{from} -> $ref->{to} " . atime($ref->{t}) . " ignored") if isdbg('msg');
+ Log('msg', "old message from $ref->{from} -> $ref->{to} " . cldatetime($ref->{t}) . " ignored");
+ return;
+ }
+
# does an identical message already exist?
my $m;
for $m (@msg) {
# does an identical message already exist?
my $m;
for $m (@msg) {
@@
-469,7
+477,7
@@
sub notify
my $ref = shift;
my $to = $ref->{to};
my $uref = DXUser->get_current($to);
my $ref = shift;
my $to = $ref->{to};
my $uref = DXUser->get_current($to);
- my $dxchan = DXChannel
->
get($to);
+ my $dxchan = DXChannel
::
get($to);
if (((*Net::SMTP && $email_server) || $email_prog) && $uref && $uref->wantemail) {
my $email = $uref->email;
if ($email) {
if (((*Net::SMTP && $email_server) || $email_prog) && $uref && $uref->wantemail) {
my $email = $uref->email;
if ($email) {