Adjust the wget parameters to keep it from indefinitely hanging; set IPv4 as the preferred protocol.

This commit is contained in:
dlandon
2022-10-28 14:33:33 -05:00
parent bccd4ee9f8
commit 68daff656b

View File

@@ -234,7 +234,7 @@ function download($url, $name, &$error, $write=true) {
if ($url) {
$plg = basename($url);
$plg = str_replace('"', '', $plg);
if ($file = popen("wget --compression=auto --no-cache --progress=dot --retry-connrefused --timeout=30 --tries=5 --waitretry=5 -O $name $url 2>&1", 'r')) {
if ($file = popen("wget --compression=auto --no-cache --progress=dot --retry-connrefused --prefer-family=IPv4 --timeout=5 --tries=3 --waitretry=3 -O $name $url 2>&1", 'r')) {
if ($write) write("plugin: downloading: $plg ...\r");
$level = -1;
while (($line = fgets($file)) !== false) {