summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Process
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-04-10 09:00:08 +0000
committerfukachan <fukachan>2002-04-10 09:00:08 +0000
commitf92ea709069a4ed1590aa2f119e2ccdd53ffce75 (patch)
treeafbaaccd2ec026b9c15e0e58a153ed90c6c7fa31 /fml/lib/FML/Process
parent3328b8546ba20085896a1cf58270c42348a037cd (diff)
downloadfml8-f92ea709069a4ed1590aa2f119e2ccdd53ffce75.tar.gz
fml8-f92ea709069a4ed1590aa2f119e2ccdd53ffce75.tar.bz2
fml8-f92ea709069a4ed1590aa2f119e2ccdd53ffce75.zip
clean up. FNF-ify
Diffstat (limited to 'fml/lib/FML/Process')
-rw-r--r--fml/lib/FML/Process/Distribute.pm26
-rw-r--r--fml/lib/FML/Process/ThreadTrack.pm38
2 files changed, 33 insertions, 31 deletions
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm
index b84c4a05..dc91b4c4 100644
--- a/fml/lib/FML/Process/Distribute.pm
+++ b/fml/lib/FML/Process/Distribute.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Distribute.pm,v 1.67 2002/03/31 03:39:14 fukachan Exp $
+# $FML: Distribute.pm,v 1.68 2002/04/10 04:31:09 fukachan Exp $
#
package FML::Process::Distribute;
@@ -12,16 +12,15 @@ use vars qw($debug @ISA @EXPORT @EXPORT_OK);
use strict;
use Carp;
-use FML::Process::Kernel;
use FML::Log qw(Log LogWarn LogError);
use FML::Config;
-
+use FML::Process::Kernel;
@ISA = qw(FML::Process::Kernel);
=head1 NAME
-FML::Process::Distribute -- fml5 article distributer library.
+FML::Process::Distribute -- article distributer library.
=head1 SYNOPSIS
@@ -46,7 +45,7 @@ we bless it as C<FML::Process::Distribute> object again.
=cut
-# Descriptions: constructor.
+# Descriptions: ordinary constructor.
# sub class of FML::Process::Kernel
# Arguments: OBJ($self) HASH_REF($args)
# Side Effects: none
@@ -68,18 +67,18 @@ forward the request to the base class.
# Descriptions: prepare miscellaneous work before the main routine starts
-# Arguments: OBJ($self) HASH_REF($args)
+# Arguments: OBJ($curproc) HASH_REF($args)
# Side Effects: none
# Return Value: none
sub prepare
{
- my ($self, $args) = @_;
- my $config = $self->{ config };
+ my ($curproc, $args) = @_;
+ my $config = $curproc->{ config };
my $eval = $config->get_hook( 'distribute_prepare_start_hook' );
if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
- $self->SUPER::prepare($args);
+ $curproc->SUPER::prepare($args);
$eval = $config->get_hook( 'distribute_prepare_end_hook' );
if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
@@ -94,8 +93,11 @@ check the mail sender and the mail loop possibility.
# Descriptions: verify the mail sender and others
+# 1. verify user credential
+# 2. primitive loop check
+# 3. filter
# Arguments: OBJ($curproc) HASH_REF($args)
-# Side Effects: lock
+# Side Effects: none
# Return Value: none
sub verify_request
{
@@ -114,6 +116,10 @@ sub verify_request
}
+# Descriptions: filter
+# Arguments: OBJ($curproc) HASH_REF($args)
+# Side Effects: set flag to ignore this process if it should be filtered.
+# Return Value: none
sub _check_filter
{
my ($curproc, $args) = @_;
diff --git a/fml/lib/FML/Process/ThreadTrack.pm b/fml/lib/FML/Process/ThreadTrack.pm
index 15d42ee5..cdeda9aa 100644
--- a/fml/lib/FML/Process/ThreadTrack.pm
+++ b/fml/lib/FML/Process/ThreadTrack.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2001,2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: ThreadTrack.pm,v 1.24 2002/02/27 09:20:33 tmu Exp $
+# $FML: ThreadTrack.pm,v 1.25 2002/03/17 06:24:31 fukachan Exp $
#
package FML::Process::ThreadTrack;
@@ -12,10 +12,9 @@ use vars qw($debug @ISA @EXPORT @EXPORT_OK);
use strict;
use Carp;
-use FML::Process::Kernel;
use FML::Log qw(Log LogWarn LogError);
use FML::Config;
-
+use FML::Process::Kernel;
@ISA = qw(FML::Process::Kernel);
@@ -58,7 +57,7 @@ sub new
# Descriptions: dummy to avoid to take data from STDIN
-# Arguments: OBJ($self) HASH_REF($args)
+# Arguments: OBJ($curproc) HASH_REF($args)
# Side Effects: none
# Return Value: none
sub prepare
@@ -74,8 +73,8 @@ sub prepare
}
-# Descriptions: none
-# Arguments: OBJ($self) HASH_REF($args)
+# Descriptions: dummy.
+# Arguments: OBJ($curproc) HASH_REF($args)
# Side Effects: none.
# Return Value: none
sub verify_request
@@ -99,9 +98,9 @@ call the actual thread tracking system.
=cut
-# Descriptions: switch of commands to use Mail::ThreadTrack module
+# Descriptions: switch to Mail::ThreadTrack module
# Arguments: OBJ($curproc) HASH_REF($args)
-# Side Effects: load module
+# Side Effects: load module if needed
# Return Value: none
sub run
{
@@ -199,6 +198,10 @@ sub run
}
+# Descriptions:
+# Arguments: OBJ($curproc) OBJ($thread)
+# Side Effects: none
+# Return Value: none
sub _speculate_last_id
{
my ($curproc, $thread) = @_;
@@ -213,7 +216,9 @@ sub _speculate_last_id
use File::stat;
my $st = stat($seq_file);
$sf_last_modified =
- $sf_last_modified > $st->mtime ? $sf_last_modified : $st->mtime;
+ $sf_last_modified > $st->mtime ?
+ $sf_last_modified :
+ $st->mtime;
};
}
@@ -222,18 +227,16 @@ sub _speculate_last_id
# updaiteing $seq_file.
# XXX 3600 is the magic number. How long time is appropriate ?
if (-f $seq_file &&
- ($sf_last_modified + 3600 > $db_last_modified)
- ) {
+ ($sf_last_modified + 3600 > $db_last_modified)) {
print STDERR "read seqfile\n"; sleep 3;
eval q{
use File::Sequence;
- my $sfh = new File::Sequence { sequence_file => $seq_file };
+ my $sfh = new File::Sequence { sequence_file => $seq_file };
return $sfh->get_id();
};
warn($@) if $@;
}
else {
-
my $last_id = 0;
$thread->db_open();
@@ -323,7 +326,7 @@ sub _read_filter_list
# Descriptions: change status to "closed".
# $thread_id accepts MH style format.
# MH style is expanded by C<Mail::Messsage::MH>.
-# Arguments: OBJ($self) HASH_REF($args)
+# Arguments: OBJ($thread) STR($thread_id) NUM($min) NUM($max)
# Side Effects: update thread status database
# Return Value: none
sub _close
@@ -396,13 +399,6 @@ sub finish
sub DESTROY {}
-sub AUTOLOAD
-{
- my ($curproc, $args) = @_;
- 1;
-}
-
-
package FML::Process::ThreadTrack::CUI;
use vars qw($debug @ISA @EXPORT @EXPORT_OK);