[svn:qpsmtpd] r553 - branches/0.31/lib/Qpsmtpd

[email protected] 20 Oct 2005 02:10:32 -0000
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
Author: jpeacock
Date: Wed Oct 19 19:10:32 2005
New Revision: 553

Modified:
   branches/0.31/lib/Qpsmtpd/Transaction.pm
Log:
* lib/Qpsmtpd/Transaction.pm
    Fix fairly egregious error.  If the size_threashold is smaller than
    the body while writing, the file handle would be closed prematurely.
    Ouch.  I don't like it here from a stylistic point of view, but at 
    least it will actually work now.

Modified: branches/0.31/lib/Qpsmtpd/Transaction.pm
==============================================================================
--- branches/0.31/lib/Qpsmtpd/Transaction.pm	(original)
+++ branches/0.31/lib/Qpsmtpd/Transaction.pm	Wed Oct 19 19:10:32 2005
@@ -91,6 +91,7 @@ sub body_current_pos {
 sub body_filename {
   my $self = shift;
   $self->body_spool() unless $self->{_filename};
+  $self->{_body_file}->close(); # so contents won't be cached
   return $self->{_filename};
 }
 
@@ -107,7 +108,6 @@ sub body_spool {
     $self->{_body_start} = $self->{_header_size};
   }
   $self->{_body_array} = undef;
-  $self->{_body_file}->close();
 }
 
 sub body_write {