mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
ids-functions.pl: Remove temporary files if the downloader aborts.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -427,6 +427,9 @@ sub downloadruleset ($) {
|
||||
|
||||
# Check if the server responds with 304 (Not Modified).
|
||||
} elsif ($response->code == 304) {
|
||||
# Remove temporary file, if one exists.
|
||||
unlink("$tmpfile") if (-e "$tmpfile");
|
||||
|
||||
# Return "not modified".
|
||||
return "not modified";
|
||||
|
||||
@@ -435,6 +438,9 @@ sub downloadruleset ($) {
|
||||
# Obtain error.
|
||||
my $error = $response->content;
|
||||
|
||||
# Remove temporary file, if one exists.
|
||||
unlink("$tmpfile") if (-e "$tmpfile");
|
||||
|
||||
# Return the error message from response..
|
||||
return "$error";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user