summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormax <max@tclers.tk>2014-03-10 18:11:08 (GMT)
committermax <max@tclers.tk>2014-03-10 18:11:08 (GMT)
commit4964ea0ff919aca3e872155d323cd72868cb93f3 (patch)
treefc99721f9ac6869e4f7cad85a7209198940d905d /tests
parent138267abe275e454e892fe55ad5f3e16fd032278 (diff)
downloadtcl-4964ea0ff919aca3e872155d323cd72868cb93f3.zip
tcl-4964ea0ff919aca3e872155d323cd72868cb93f3.tar.gz
tcl-4964ea0ff919aca3e872155d323cd72868cb93f3.tar.bz2
WaitForConnect may only call back to CreateClientSocket when the socket is writable or something. When it does so for a pending socket, it is falsely assumed to have succeeded and a subsequent read/write operation will fail.
Diffstat (limited to 'tests')
-rw-r--r--tests/socket.test4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/socket.test b/tests/socket.test
index bfe6990..a21bb8d 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -2006,7 +2006,7 @@ test socket-14.8.0 {pending [socket -async] and nonblocking [gets], server is IP
set sock [socket -async localhost $port]
fconfigure $sock -blocking 0
for {set i 0} {$i < 50} {incr i } {
- if {[set x [gets $sock]] ne ""} break
+ if {[catch {gets $sock} x] || $x ne "" || ![fblocked $sock]} break
after 200
}
set x
@@ -2032,7 +2032,7 @@ test socket-14.8.1 {pending [socket -async] and nonblocking [gets], server is IP
set sock [socket -async localhost $port]
fconfigure $sock -blocking 0
for {set i 0} {$i < 50} {incr i } {
- if {[set x [gets $sock]] ne ""} break
+ if {[catch {gets $sock} x] || $x ne "" || ![fblocked $sock]} break
after 200
}
set x