|
From: <jgr...@us...> - 2003-07-11 02:12:46
|
Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv28660
Modified Files:
Bayes.pm
Log Message:
Fix a bug where the headers of messages larger than 100000 bytes were going to be corrupted because of the latest change I made to write the MSG file after the CLS
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.163
retrieving revision 1.164
diff -C2 -d -r1.163 -r1.164
*** Bayes.pm 9 Jul 2003 21:53:19 -0000 1.163
--- Bayes.pm 11 Jul 2003 02:12:43 -0000 1.164
***************
*** 1011,1015 ****
my $getting_headers = 1;
! my $temp_file = $self->history_filename($dcount,$mcount, ".msg",1);
my $nopath_temp_file = $self->history_filename($dcount,$mcount,".msg",0);
--- 1011,1016 ----
my $getting_headers = 1;
! my $msg_file = $self->history_filename($dcount,$mcount, ".msg",1);
! my $temp_file = "$msg_file.tmp";
my $nopath_temp_file = $self->history_filename($dcount,$mcount,".msg",0);
***************
*** 1026,1030 ****
# get class file errors
! open TEMP, ">$temp_file.tmp";
while ( <$mail> ) {
--- 1027,1031 ----
# get class file errors
! open TEMP, ">$temp_file";
while ( <$mail> ) {
***************
*** 1209,1213 ****
if ( ( $self->{parameters__}{$classification}{quarantine} == 1 ) && $echo ) {
print $client "$eol--$temp_file--$eol";
! }
}
--- 1210,1214 ----
if ( ( $self->{parameters__}{$classification}{quarantine} == 1 ) && $echo ) {
print $client "$eol--$temp_file--$eol";
! }
}
***************
*** 1226,1230 ****
# file error since it was already written
! rename "$temp_file.tmp", $temp_file;
}
--- 1227,1232 ----
# file error since it was already written
! unlink $msg_file;
! rename $temp_file, $msg_file;
}
|