mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
fw-addr-lists: warn on possible truncation
... as fetch truncates data at about 64kB, reported in SUP-132297.
This commit is contained in:
parent
db5ff00b5a
commit
f9528f0ac5
1 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
||||||
:global CertificateAvailable;
|
:global CertificateAvailable;
|
||||||
:global EitherOr;
|
:global EitherOr;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
|
:global LogPrintOnce;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
|
@ -72,6 +73,10 @@ $WaitFullyConnected;
|
||||||
$LogPrintExit2 warning $0 ("Failed downloading list from: " . $List->"url") false;
|
$LogPrintExit2 warning $0 ("Failed downloading list from: " . $List->"url") false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:if ([ :len $Data ] > 63000) do={
|
||||||
|
$LogPrintOnce warning $0 ("The list is huge and may be truncated: " . $List->"url");
|
||||||
|
}
|
||||||
|
|
||||||
:while ([ :len $Data ] != 0) do={
|
:while ([ :len $Data ] != 0) do={
|
||||||
:local Line [ :pick $Data 0 [ :find $Data "\n" ] ];
|
:local Line [ :pick $Data 0 [ :find $Data "\n" ] ];
|
||||||
:local Address ([ :pick $Line 0 [ $FindDelim $Line ] ] . ($List->"cidr"));
|
:local Address ([ :pick $Line 0 [ $FindDelim $Line ] ] . ($List->"cidr"));
|
||||||
|
|
Loading…
Reference in a new issue