summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-01-13 11:45:52 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-01-13 11:45:52 (GMT)
commitdd2ad07b7f17937585812360682cef3aed8ceb86 (patch)
tree156f68bb67344c2d036d9ae1a0ac96b9db859002
parent05a1c1c8d017993fac4875d1baed7e62ece0bd93 (diff)
downloadtcl-dd2ad07b7f17937585812360682cef3aed8ceb86.zip
tcl-dd2ad07b7f17937585812360682cef3aed8ceb86.tar.gz
tcl-dd2ad07b7f17937585812360682cef3aed8ceb86.tar.bz2
* library/http/http.tcl (http::Connect): [Bug 3472316]: Ensure that we
only try to read the socket error exactly once.
-rw-r--r--ChangeLog5
-rw-r--r--library/http/http.tcl5
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1b0d341..6b49989 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-13 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/http/http.tcl (http::Connect): [Bug 3472316]: Ensure that we
+ only try to read the socket error exactly once.
+
2012-01-09 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tclUtf.c: [Bug 3464428] string is graph \u0120 is wrong
diff --git a/library/http/http.tcl b/library/http/http.tcl
index e8a7c1e..1496d63 100644
--- a/library/http/http.tcl
+++ b/library/http/http.tcl
@@ -707,10 +707,9 @@ proc http::cleanup {token} {
proc http::Connect {token} {
variable $token
upvar 0 $token state
- global errorInfo errorCode
if {[eof $state(sock)] ||
- [string length [fconfigure $state(sock) -error]]} {
- Finish $token "connect failed [fconfigure $state(sock) -error]" 1
+ [string length [set err [fconfigure $state(sock) -error]]]} {
+ Finish $token "connect failed $err" 1
} else {
set state(status) connect
fileevent $state(sock) writable {}