Bug 23685: Don't store ODS content in a variable to save memory

Just attaching this to start.

Sponsored-by: Waikato Institute of Technology

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Aleisha Amohia 2024-06-25 21:43:22 +00:00 committed by Katrin Fischer
parent c8869aea1c
commit 2bf41eb65d
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -690,7 +690,11 @@ elsif ($op eq 'export'){
# Output
binmode(STDOUT);
open $ods_fh, '<', $ods_filepath;
$content .= $_ while <$ods_fh>;
print $input->header(
-type => $type,
-attachment => $reportfilename
);
print $_ while <$ods_fh>;
unlink $ods_filepath;
}
elsif ( $format eq 'template' ) {
@ -714,11 +718,14 @@ elsif ($op eq 'export'){
);
}
}
print $input->header(
-type => $type,
-attachment=> $reportfilename
);
print $content;
unless ( $format eq 'ods' ) {
print $input->header(
-type => $type,
-attachment => $reportfilename
);
print $content;
}
foreach my $err (@$q_errors, @errors) {
print "# ERROR: " . (map {$_ . ": " . $err->{$_}} keys %$err) . "\n";