diff options
| author | fukachan <fukachan> | 2004-06-27 02:39:30 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-06-27 02:39:30 +0000 |
| commit | 8fe2145048ec52fa69c40f64fd6b7f0c199f9269 (patch) | |
| tree | 78d300bb970dc5e0118be32764a709c267c61de1 /fml/lib/Mail/Delivery/Queue.pm | |
| parent | ca094cc922751df12f257c93fd9e443db5085fa0 (diff) | |
| download | fml8-8fe2145048ec52fa69c40f64fd6b7f0c199f9269.tar.gz fml8-8fe2145048ec52fa69c40f64fd6b7f0c199f9269.tar.bz2 fml8-8fe2145048ec52fa69c40f64fd6b7f0c199f9269.zip | |
queue system debug: trace number of bytes written.
Diffstat (limited to 'fml/lib/Mail/Delivery/Queue.pm')
| -rw-r--r-- | fml/lib/Mail/Delivery/Queue.pm | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/fml/lib/Mail/Delivery/Queue.pm b/fml/lib/Mail/Delivery/Queue.pm index a6deb3b4..174353f8 100644 --- a/fml/lib/Mail/Delivery/Queue.pm +++ b/fml/lib/Mail/Delivery/Queue.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Queue.pm,v 1.36 2004/05/24 15:18:33 fukachan Exp $ +# $FML: Queue.pm,v 1.37 2004/05/25 03:43:02 fukachan Exp $ # package Mail::Delivery::Queue; @@ -379,6 +379,25 @@ sub in $self->error_set("write error"); } $fh->close; + + my $write_count = $self->{ _write_count } = $msg->write_count(); + + use File::stat; + my $try_count = 3; + my $ok = 0; + TRY: + while ($try_count-- > 0) { + my $st = stat($qf); + if ($st->size == $write_count) { + $ok = 1; + last TRY; + } + sleep 1; + } + + unless ($ok) { + $self->error_set("write error: size mismatch"); + } } # check the existence and the size > 0. @@ -386,6 +405,17 @@ sub in } +# Descriptions: return num of bytes written successfully. +# Arguments: OBJ($self) +# Side Effects: none +# Return Value: NUM +sub write_count +{ + my ($self) = @_; + return $self->{ _write_count }; +} + + =head2 set($key, $args) $queue->set('sender', $sender); |
