summaryrefslogtreecommitdiffstats
path: root/library/http2.3/http.tcl
diff options
context:
space:
mode:
authorsandeep <sandeep>2000-03-19 23:45:38 (GMT)
committersandeep <sandeep>2000-03-19 23:45:38 (GMT)
commit681c866be727a03776c6028f53bdae31049f770b (patch)
treeeb02f124ee8700d3575305b094b79b6634e36dfd /library/http2.3/http.tcl
parent442e6551351a2b2547562fcb091d24518900f248 (diff)
downloadtcl-681c866be727a03776c6028f53bdae31049f770b.zip
tcl-681c866be727a03776c6028f53bdae31049f770b.tar.gz
tcl-681c866be727a03776c6028f53bdae31049f770b.tar.bz2
2000-03-19 Sandeep Tamhankar <sandeep@scriptics.com>scriptics_sc_2_0_b1
* library/http2.1/http.tcl: geturl used to throw an exception when the connection failed; I accidentally returned a token with the error info, breaking backwards compatibility. I changed it back to throwing an exception, but unsetting the state array first (thus still eliminating the original memory leak problem).
Diffstat (limited to 'library/http2.3/http.tcl')
-rw-r--r--library/http2.3/http.tcl15
1 files changed, 10 insertions, 5 deletions
diff --git a/library/http2.3/http.tcl b/library/http2.3/http.tcl
index b783dc7..a0e50d2 100644
--- a/library/http2.3/http.tcl
+++ b/library/http2.3/http.tcl
@@ -9,7 +9,7 @@
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: http.tcl,v 1.23 2000/03/19 22:32:26 sandeep Exp $
+# RCS: @(#) $Id: http.tcl,v 1.24 2000/03/19 23:45:38 sandeep Exp $
package provide http 2.3 ;# This uses Tcl namespaces
@@ -314,10 +314,15 @@ proc http::geturl { url args } {
set conStat [catch {eval $defcmd $async {$host $port}} s]
}
if {$conStat} {
- # something went wrong, so unset the state array and propagate the
- # error to the caller
- Finish $token $s
- return $token
+ # something went wrong while trying to establish the connection
+ # The proper response is probably to give the caller a token
+ # containing error info, but that would break backwards compatibility.
+ # So, let's follow tradition and throw an exception (after unsetting
+ # the array).
+ unset $token
+ error $s
+ #Finish $token $s
+ #return $token
}
set state(sock) $s