jason22plays / winetricks

Automatically exported from code.google.com/p/winetricks
0 stars 0 forks source link

Wget sometimes stalls while downloading in Winetricks #442

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. There is a disturbance in the internet connection, even a slight fluctuation 
in the received or transmitted signal or a hiccup in the server that wget is 
connecting to can cause it
2. Wget sits and waits for the transmission to resume, it can end up sitting 
there for a long time
3.The transmission does not resume on the server's end, wget does nothing and 
makes no attempt to reconnect

What version of the product are you using? On what operating system?

Latest version of Winetricks, Ubuntu Trusty Tahr

Please provide any additional information below.

Perhaps this block of code can be adapted to allowing wget to resume a download 
and added to Winetricks:

DownloadFile (){
for Number in {1..120}
do
eval 'wget --waitretry=1 --read-timeout=20 --timeout=15 -t 0 --continue '$1' 
--header="User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:23.0) Gecko/20100101 
Firefox/23.0"'
Check=$?
if [ $Check -ne 0 ]
then
echo 'Download failed, retrying in 5 seconds...'
sleep 5
if [ $Number -ne 120 ]
then
echo 'Retrying download'
fi
else
break
fi
done
}

This function call terminates the download if unsuccessful and then starts 
downloading again continuing where wget left off.  Feel free to play around 
with it and if it helps use it.

Original issue reported on code.google.com by smo...@gmail.com on 9 Oct 2014 at 6:49