diff options
author | hobbs <hobbs> | 2000-06-02 23:14:46 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2000-06-02 23:14:46 (GMT) |
commit | 6c22497d0dc33e940aaaf046a4b9095230f3fdfc (patch) | |
tree | c78759288a232843427f9d65c749536bbf18b018 /tests | |
parent | 5ff01d5b12c7156cf3f712e9844a1763f429fbcb (diff) | |
download | tcl-6c22497d0dc33e940aaaf046a4b9095230f3fdfc.zip tcl-6c22497d0dc33e940aaaf046a4b9095230f3fdfc.tar.gz tcl-6c22497d0dc33e940aaaf046a4b9095230f3fdfc.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.test | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/http.test b/tests/http.test index 4efde80..c18a3c9 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.20 2000/06/02 23:14:47 hobbs 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] |