summaryrefslogtreecommitdiffstats
path: root/tests/httpd
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-09-05 12:28:41 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-09-05 12:28:41 (GMT)
commit018892450cdacc7e4660a4cc138a51e1143a2b12 (patch)
treebc8d5053c422ca180b237864f9522bb64c885cf9 /tests/httpd
parentd23fe52664cbef62956cc8ba4e689b9873992b0c (diff)
parentedb7af10d93df44cc25e9dce384c61669ce73dc8 (diff)
downloadtcl-tip_282.zip
tcl-tip_282.tar.gz
tcl-tip_282.tar.bz2
merge trunktip_282
Diffstat (limited to 'tests/httpd')
-rw-r--r--tests/httpd9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/httpd b/tests/httpd
index f15d71b..982f3b8 100644
--- a/tests/httpd
+++ b/tests/httpd
@@ -10,6 +10,13 @@
#set httpLog 1
+if {$::tcl_platform(os) eq "Darwin"} {
+ # Name resolution often a problem on OSX; not focus of HTTP package anyway
+ set HOST localhost
+} else {
+ set HOST [info hostname]
+}
+
proc httpd_init {{port 8015}} {
set s [socket -server httpdAccept $port]
# Save the actual port number in a global variable.
@@ -173,7 +180,7 @@ proc httpdRespond { sock } {
switch -glob -- $data(url) {
*binary* {
- set html "$bindata[info hostname]:$port$data(url)"
+ set html "$bindata${::HOST}:$port$data(url)"
set type application/octet-stream
}
*xml* {