mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 00:24:51 +00:00
check_port_source: download first kilobytes of file
Unfortunately, some sites do not support the HTTP/1.1 range header and just serve the whole file, which takes it's time and may result in a timeout. Fixes #2819
This commit is contained in:
parent
d450573681
commit
0f7de9268d
@ -54,11 +54,14 @@ check: $(DOWNLOADS)
|
|||||||
#
|
#
|
||||||
# Check plain remote file
|
# Check plain remote file
|
||||||
#
|
#
|
||||||
|
# Try to download first kilobytes at maximum, which succeeds with return code 0
|
||||||
|
# on small files or "(63) Maximum file size exceeded" if the file is larger.
|
||||||
# We call curl a second time if the first check fails. This gives download
|
# We call curl a second time if the first check fails. This gives download
|
||||||
# sites time to reconsider their response and helps, for example, to check the
|
# sites time to reconsider their response and helps, for example, to check the
|
||||||
# qemu-usb port.
|
# qemu-usb port.
|
||||||
#
|
#
|
||||||
CURL_CMD = curl -f -L -k -r -2 --max-time 15 --retry 2 $(URL($*)) > /dev/null 2>&1
|
CURL_CMD = curl -s -f -L -k --max-filesize 200000 \
|
||||||
|
--max-time 15 --retry 1 $(URL($*)) > /dev/null || [ $$? -eq 63 ]
|
||||||
%.file:
|
%.file:
|
||||||
$(VERBOSE)$(CURL_CMD) || (sleep 1; $(CURL_CMD))
|
$(VERBOSE)$(CURL_CMD) || (sleep 1; $(CURL_CMD))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user