summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorsandeep <sandeep>2000-05-31 01:28:55 (GMT)
committersandeep <sandeep>2000-05-31 01:28:55 (GMT)
commitf5f35eb289ea0bbcc21f60746f10922fd20891ca (patch)
treed2cb7cd3e5ca0e90883c0d6aaa5f8471032e8557 /tests
parent492f9b8edd489f07ffd0741d0e9f23c0433334f9 (diff)
downloadtcl-f5f35eb289ea0bbcc21f60746f10922fd20891ca.zip
tcl-f5f35eb289ea0bbcc21f60746f10922fd20891ca.tar.gz
tcl-f5f35eb289ea0bbcc21f60746f10922fd20891ca.tar.bz2
2000-05-29 Sandeep Tamhankar <sandeep@scriptics.com>
* tests/http.test * doc/http.n * library/http2.3/http.tcl: Fixed bug 5741, where unsuccessful geturl calls sometimes leaked memory and resources (sockets). Also, switched around some of the logic so that http::wait never throws an exception. This is because in an asynchronous geturl, the command callback will probably end up doing all the error handling anyway, and in an asynchronous situation, the user expects to check the state when the transaction completes, as opposed to being thrown an exception. For the http package, this menas the user can check http::status for "error" and http::error for the error message after doing the http::wait.
Diffstat (limited to 'tests')
-rw-r--r--tests/http.test13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/http.test b/tests/http.test
index 4efde80..275b627 100644
--- a/tests/http.test
+++ b/tests/http.test
@@ -6,13 +6,13 @@
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
-# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 1998-2000 by Ajuba Solutions.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
-# RCS: @(#) $Id: http.test,v 1.19 2000/04/22 07:07:59 sandeep Exp $
+# RCS: @(#) $Id: http.test,v 1.19.2.1 2000/05/31 01:28:57 sandeep Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -290,6 +290,15 @@ test http-3.12 {http::geturl querychannel with aborted request} {nonPortable} {
list [http::status $t] [http::code $t]
} {ok {HTTP/1.0 200 Data follows}}
+test http-3.13 {http::geturl socket leak test} {
+ set chanCount [llength [file channels]]
+ for {set i 0} {$i<200} {incr i} {
+ catch {http::geturl $badurl -timeout 10000}
+ }
+
+ # No extra channels should be taken
+ expr {[llength [file channels]] == $chanCount}
+} 1
test http-4.1 {http::Event} {
set token [http::geturl $url]