Lines Matching +full:local +full:- +full:host

3 # Copyright (c) 2012-2013 Devin Teske
49 # NOTE: This is according to actual fetch(1) test-results. We actually
60 pub/FreeBSD-Archive/old-releases/$UNAME_P
61 " # END-QUOTE
67 # Prompt the user to select from a range of ``built-in'' HTTP servers or
75 local title="$DIALOG_TITLE" btitle="$DIALOG_BACKTITLE"
77 local prompt="$msg_please_select_the_site_closest_to_you_or_other"
78 local menu_list="
81 " # END-QUOTE
82 local hline="$msg_select_a_site_thats_close"
84 local height width rows
92 local mtag
94 --title \"\$title\" \
95 --backtitle \"\$btitle\" \
96 --hline \"\$hline\" \
97 --ok-label \"\$msg_ok\" \
98 --cancel-label \"\$msg_cancel\" \
99 --menu \"\$prompt\" \
109 local value
124 # URL containing host and optionally a target path to the release
141 # The HTTP host to connect to, parsed from VAR_HTTP_PATH. In the
162 local url
186 if [ ${#url} -gt ${URL_MAX:-261261} ]; then
188 ${#url} ${URL_MAX:-261261}
221 local dev if
223 f_device_find -1 "$if" $DEVICE_TYPE_NETWORK dev
232 local hostname="${url#*://}" port=80 dir=/
235 # The order in-which the below individual cases appear is important!
242 port="${port%%[!0-9]*}"
250 port="${port%%[!0-9]*}"
271 port="${port%%[!0-9]*}"
289 : leave hostname as-is
296 local ns
299 if [ "$ns" -a ! "$HTTP_SKIP_RESOLV" ] && ! {
304 f_dprintf "%s: Looking up hostname, %s, using host(1)" \
335 # present and non-null, then returns success if a connection can be made.
339 # The HTTP server host name, IPv4 address or IPv6 address.
348 # present and non-NULL.
352 local connect_only="$1" hosts=
354 local http_host http_port
362 f_dprintf "%s: Looking up hostname, %s, using host(1)" \
376 local host connected=
377 for host in $hosts; do
378 f_quietly nc -nz "$host" "$http_port" || continue
389 local http_path
393 local rx
400 nc -n "$host" "$http_port"
408 local hdr
411 local http_found=$FAILURE
438 # Usually set to `uname -r' but can be overridden.
452 local dev="$1"
463 local connect_only=1
466 local http_host
474 local http_path http_found=$FAILURE
483 local rel
499 local fdir hp
516 [ $http_found -eq $SUCCESS ] && HTTP_INITIALIZED=YES break
533 # gathered from the environment. If $probe_type is both present and non-NULL,
536 # If $probe_type is equal to $PROBE_SIZE, prints the content-length in bytes
537 # from the response (or -1 if not found) to standard-out.
563 local dev="$1" file="$2" probe_type="$3" hosts=
564 local name
570 local http_host http_port
583 f_dprintf "%s: Looking up hostname, %s, using host(1)" \
596 local host connected=
597 for host in $hosts; do
598 f_quietly nc -nz "$host" "$http_port" || continue
607 local http_path
614 local url="$http_path/$file" rx
616 f_dprintf "using nc to connect to: %s:%s" "$host" "$http_port"
617 printf "GET %s HTTP/1.0\r\n\r\n" "$url" | nc -n "$host" "$http_port" |
624 rv=0 length=-1
629 set -- $LINE; rv=$2
632 "Content-Length: "*)
635 length="${length#Content-Length: }"
636 f_dprintf "received content-length: %s" \
645 [ $rv -ge 500 ] && exit 5
646 [ $rv -eq 404 ] && exit 44
647 [ $rv -ge 400 ] && exit 4
648 [ $rv -ge 300 ] && exit 3
649 [ $rv -eq 200 ] || exit $FAILURE
652 cat # output the rest ``as-is''
654 f_isinteger "$length" || length=-1
659 local retval=$?
660 [ $retval -eq 200 ] && return $SUCCESS