summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-08-10 19:44:56 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-08-10 19:44:56 (GMT)
commit4e12c83774ba3d73e4970089e9c04a886bdbae94 (patch)
tree266802543d21fd0030d3e2eb7ce2ffdb736c6b69 /generic/tclIO.c
parent65a1eba1c52ddc116e497797087705b420514244 (diff)
downloadtcl-4e12c83774ba3d73e4970089e9c04a886bdbae94.zip
tcl-4e12c83774ba3d73e4970089e9c04a886bdbae94.tar.gz
tcl-4e12c83774ba3d73e4970089e9c04a886bdbae94.tar.bz2
Add the critical missing UpdateInterest() call at the exit of DoRead().
(Compare with same approach in DoReadChars()). This involves removing some other calls that are now replaced by the new one. Also marked several UpdateInterest() calls throughout tclIO.c with comments raising the suspicion that they serve no function.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 564df27..9a4735f 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -5317,6 +5317,7 @@ DoReadChars(
assert( statePtr->inputEncodingFlags & TCL_ENCODING_END );
assert( !GotFlag(statePtr, CHANNEL_BLOCKED|INPUT_SAW_CR) );
+ /* TODO: We don't need this call? */
UpdateInterest(chanPtr);
return 0;
}
@@ -5328,6 +5329,7 @@ DoReadChars(
}
ResetFlag(statePtr, CHANNEL_BLOCKED|CHANNEL_EOF);
statePtr->inputEncodingFlags &= ~TCL_ENCODING_END;
+ /* TODO: We don't need this call? */
UpdateInterest(chanPtr);
return 0;
}
@@ -7910,6 +7912,11 @@ Tcl_NotifyChannel(
*/
if (chanPtr->typePtr != NULL) {
+ /*
+ * TODO: This call may not be needed. If a handler induced a
+ * change in interest, that handler should have made its own
+ * UpdateInterest() call, one would think.
+ */
UpdateInterest(chanPtr);
}
@@ -9032,6 +9039,7 @@ DoRead(
assert( statePtr->inputEncodingFlags & TCL_ENCODING_END );
assert( !GotFlag(statePtr, CHANNEL_BLOCKED|INPUT_SAW_CR) );
+ /* TODO: Don't need this call */
UpdateInterest(chanPtr);
return 0;
}
@@ -9043,6 +9051,7 @@ DoRead(
}
ResetFlag(statePtr, CHANNEL_BLOCKED|CHANNEL_EOF);
statePtr->inputEncodingFlags &= ~TCL_ENCODING_END;
+ /* TODO: Don't need this call */
UpdateInterest(chanPtr);
return 0;
}
@@ -9109,7 +9118,6 @@ DoRead(
*/
if (bytesToRead == 0) {
- UpdateInterest(chanPtr);
break;
}
@@ -9118,7 +9126,6 @@ DoRead(
*/
if (GotFlag(statePtr, CHANNEL_STICKY_EOF)) {
- UpdateInterest(chanPtr);
break;
}
@@ -9143,7 +9150,6 @@ DoRead(
} else if (GotFlag(statePtr, CHANNEL_BLOCKED)) {
/* ...and we cannot get more now. */
SetFlag(statePtr, CHANNEL_NEED_MORE_DATA);
- UpdateInterest(chanPtr);
break;
} else {
/* ... so we need to get some. */
@@ -9195,6 +9201,7 @@ DoRead(
|| Tcl_InputBuffered((Tcl_Channel)chanPtr) == 0);
assert( !(GotFlag(statePtr, CHANNEL_EOF|CHANNEL_BLOCKED)
== (CHANNEL_EOF|CHANNEL_BLOCKED)) );
+ UpdateInterest(chanPtr);
TclChannelRelease((Tcl_Channel)chanPtr);
return (int)(p - dst);
}