summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorsandeep <sandeep@noemail.net>2000-05-31 01:28:54 (GMT)
committersandeep <sandeep@noemail.net>2000-05-31 01:28:54 (GMT)
commita082b1efa3b21e943d70b2bf46efe27f59a13e05 (patch)
treed2cb7cd3e5ca0e90883c0d6aaa5f8471032e8557 /tests
parenta0228c8a640edd842eff025d2542153404f38842 (diff)
downloadtcl-a082b1efa3b21e943d70b2bf46efe27f59a13e05.zip
tcl-a082b1efa3b21e943d70b2bf46efe27f59a13e05.tar.gz
tcl-a082b1efa3b21e943d70b2bf46efe27f59a13e05.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. FossilOrigin-Name: 43202241e22712cadcbde2871b6924ec05e74459
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]