summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/share/media/httpproxy.subr
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-06-23 10:04:23 +0000
committerdteske <dteske@FreeBSD.org>2013-06-23 10:04:23 +0000
commit0af114bd22d3e848242f61b97b1be058e191e691 (patch)
tree714ec3899dfaa65453d5e6b13afe2d1d2afcdeca /usr.sbin/bsdconfig/share/media/httpproxy.subr
parentb9bf1edc0c801b2f4a08a6ca2b57453ab171c95b (diff)
downloadFreeBSD-src-0af114bd22d3e848242f61b97b1be058e191e691.zip
FreeBSD-src-0af114bd22d3e848242f61b97b1be058e191e691.tar.gz
Implement the $probe_only parameter (previously unimplemented).
Diffstat (limited to 'usr.sbin/bsdconfig/share/media/httpproxy.subr')
-rw-r--r--usr.sbin/bsdconfig/share/media/httpproxy.subr11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/bsdconfig/share/media/httpproxy.subr b/usr.sbin/bsdconfig/share/media/httpproxy.subr
index 819d240..5a11323 100644
--- a/usr.sbin/bsdconfig/share/media/httpproxy.subr
+++ b/usr.sbin/bsdconfig/share/media/httpproxy.subr
@@ -333,8 +333,10 @@ f_media_init_http_proxy()
#
# Returns data from $file on an FTP server via HTTP proxy using nc(1). Please
# note that $device is unused but must be present (even if null). Information
-# is instead gathered from the environment. $probe_only is currently unused by
-# this media type.
+# is instead gathered from the environment. If $probe_only is both present and
+# non-NULL, this function exits after receiving the HTTP header response from
+# the proxy server (if the HTTP response code is 200, success is returned;
+# otherwise failure).
#
# The variables used to configure the connection are as follows (all of which
# are configured by f_media_set_http_proxy above):
@@ -425,11 +427,14 @@ f_media_get_http_proxy()
[ $rv -ge 300 ] && exit 3
[ $rv -eq 200 ] || exit $FAILURE
- cat # output the rest ``as-is''
+ if [ ! "$probe_only" ]; then
+ cat # output the rest ``as-is''
+ fi
exit 200
)
local retval=$?
[ $retval -eq 200 ] && return $SUCCESS
+ [ "$probe_only" ] && return $FAILURE
case "$retval" in
5) f_show_msg "$msg_server_error_when_requesting_url" "$url" ;;
OpenPOWER on IntegriCloud