summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2014-11-03 21:37:37 (GMT)
committerdgp <dgp@noemail.net>2014-11-03 21:37:37 (GMT)
commitf9fb3fdf514ae02fb101fd6313a63b8220310464 (patch)
tree54706c961e91e328ac9b40614f5a02e9789bf797 /generic
parent912ebe98acd78b4302c899a2281cf758a3dfb928 (diff)
downloadtcl-f9fb3fdf514ae02fb101fd6313a63b8220310464.zip
tcl-f9fb3fdf514ae02fb101fd6313a63b8220310464.tar.gz
tcl-f9fb3fdf514ae02fb101fd6313a63b8220310464.tar.bz2
Make sure reflected channels do not make a double call to Tcl_ReadRaw(),
with the unwarranted assumption that EOF is a permanent condition. FossilOrigin-Name: b3df4b3d82580f55d72a56430cbc1645736f527c
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIORTrans.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c
index 45ee08d..8f3ef3c 100644
--- a/generic/tclIORTrans.c
+++ b/generic/tclIORTrans.c
@@ -1097,6 +1097,11 @@ ReflectInput(
goto stop;
}
+ if (rtPtr->readIsDrained) {
+ goto stop;
+ }
+
+
/*
* The buffer is exhausted, but the caller wants even more. We now
* have to go to the underlying channel, get more bytes and then
@@ -1166,10 +1171,6 @@ ReflectInput(
* on the down channel.
*/
- if (rtPtr->readIsDrained) {
- goto stop;
- }
-
/*
* Now this is a bit different. The partial data waiting is
* converted and returned.