X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXMsg.pm;h=598dc7ea4cefd04771d0a19dc226e491c5d22fe9;hb=ec5995e84ce9c1b25112e1ee8a2bc7d01f033beb;hp=dbcd8097bafce544231a37f7e58565f55999e3c3;hpb=42846321acd959aa93c2c2afd2b1f0a67f8accaf;p=spider.git diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index dbcd8097..598dc7ea 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -1091,9 +1091,25 @@ sub do_send_stuff Log('msg', "line: $line"); $loc->{reject}++; } + + if ($loc->{lines} && @{$loc->{lines}}) { + push @{$loc->{lines}}, length($line) > 0 ? $line : " "; + } else { + # temporarily store any R: lines so that we end up with + # only the first and last ones stored. + if ($line =~ m|^R:\d{6}/\d{4}|) { + push @{$loc->{tempr}}, $line; + } else { + if (exists $loc->{tempr}) { + push @{$loc->{lines}}, shift @{$loc->{tempr}}; + push @{$loc->{lines}}, pop @{$loc->{tempr}} if @{$loc->{tempr}}; + delete $loc->{tempr}; + } + push @{$loc->{lines}}, length($line) > 0 ? $line : " "; + } + } # i.e. it ain't and end or abort, therefore store the line - push @{$loc->{lines}}, length($line) > 0 ? $line : " "; } } return @out;