Fix nasty bug where body wouldn't be recorded if it came in a separate packet from the header.

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@863 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Matt Sergeant 2008-03-18 15:20:13 +00:00
parent 8e3c0cf33a
commit 9415a518df

View File

@ -235,8 +235,11 @@ sub got_data {
$data =~ s/\r\n/\n/mg; $data =~ s/\r\n/\n/mg;
$data =~ s/^\.\./\./mg; $data =~ s/^\.\./\./mg;
if ($self->{in_header} and $data =~ s/\A(.*?\n)\n/\n/ms) { if ($self->{in_header}) {
$self->{header_lines} .= $1; $self->{header_lines} .= $data;
if ($self->{header_lines} =~ s/\n(\n.*)\z/\n/ms) {
$data = $1;
# end of headers # end of headers
$self->{in_header} = 0; $self->{in_header} = 0;
@ -261,9 +264,6 @@ sub got_data {
# Save the start of just the body itself # Save the start of just the body itself
$self->transaction->set_body_start(); $self->transaction->set_body_start();
} }
if ($self->{in_header}) {
$self->{header_lines} .= $data;
} }
$self->transaction->body_write(\$data); $self->transaction->body_write(\$data);