diff options
author | max <max@tclers.tk> | 2012-08-09 14:26:04 (GMT) |
---|---|---|
committer | max <max@tclers.tk> | 2012-08-09 14:26:04 (GMT) |
commit | ff7f9ca57976adcf0bd2d12b434e250cbcbbf765 (patch) | |
tree | 78d1118fee1ee6be6632005f2232ed1ae8674a1a | |
parent | 0062f8538fd9dc925e8b8e00b9ede5ff39022623 (diff) | |
download | tcl-ff7f9ca57976adcf0bd2d12b434e250cbcbbf765.zip tcl-ff7f9ca57976adcf0bd2d12b434e250cbcbbf765.tar.gz tcl-ff7f9ca57976adcf0bd2d12b434e250cbcbbf765.tar.bz2 |
Fix http-3.29 for machines without IPv6 support.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | tests/http.test | 16 |
2 files changed, 16 insertions, 4 deletions
@@ -1,3 +1,7 @@ +2012-08-09 Reinhard Max <max@suse.de> + + * tests/http.test: Fix http-3.29 for machines without IPv6 support. + 2010-08-08 Stuart Cassoff <stwo@users.sourceforge.net> * unix/tclUnixCompat.c: Change one '#ifdef' to '#if defined()' for diff --git a/tests/http.test b/tests/http.test index fe44b47..bde5795 100644 --- a/tests/http.test +++ b/tests/http.test @@ -392,11 +392,19 @@ Content-Type {text/plain;charset=utf-8} Accept-Encoding .* Content-Length 5} test http-3.29 "http::geturl $ipv6url" -body { - set token [http::geturl $ipv6url -validate 1] - http::code $token + # We only want to see if the URL gets parsed correctly. This is + # the case if http::geturl succeeds or returns a socket related + # error. If the parsing is wrong, we'll get a parse error. + # It'd be better to separate the URL parser from http::geturl, so + # that it can be tested without also trying to make a connection. + set error [catch {http::geturl $ipv6url -validate 1} token] + if {$error && [string match "couldn't open socket: *" $token]} { + set error 0 + } + set error } -cleanup { - http::cleanup $token -} -result "HTTP/1.0 200 OK" + catch { http::cleanup $token } +} -result 0 test http-4.1 {http::Event} -body { set token [http::geturl $url -keepalive 0] |