summaryrefslogtreecommitdiffstats
path: root/generic/tclZlib.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-05-19 18:29:26 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-05-19 18:29:26 (GMT)
commitab71a62c9e9b8c57834e4b4deb60b59596ad9586 (patch)
treebc6f072ca2419f0e592243a4e5fc5d9f2b544a9e /generic/tclZlib.c
parentfae66563f5f7dc9c3633a4f4d2e46e46c4ca7afc (diff)
downloadtcl-ab71a62c9e9b8c57834e4b4deb60b59596ad9586.zip
tcl-ab71a62c9e9b8c57834e4b4deb60b59596ad9586.tar.gz
tcl-ab71a62c9e9b8c57834e4b4deb60b59596ad9586.tar.bz2
Same improvements to the zlib transform operations.dgp_trunk_flag_repair
Diffstat (limited to 'generic/tclZlib.c')
-rw-r--r--generic/tclZlib.c45
1 files changed, 5 insertions, 40 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 9bceb4c..2e27303 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -2994,47 +2994,18 @@ ZlibTransformInput(
*/
if (readBytes < 0) {
- /*
- * Report errors to caller. The state of the seek system is
- * unchanged!
- */
-
- if ((Tcl_GetErrno() == EAGAIN) && (gotBytes > 0)) {
- /*
- * EAGAIN is a special situation. If we had some data before
- * we report that instead of the request to re-try.
- */
+ /* See ReflectInput() in tclIORTrans.c */
+ if (Tcl_InputBlocked(cd->parent) && (gotBytes > 0)) {
return gotBytes;
}
*errorCodePtr = Tcl_GetErrno();
return -1;
- } else if (readBytes == 0) {
- /*
- * Check wether we hit on EOF in 'parent' or not. If not,
- * differentiate between blocking and non-blocking modes. In
- * non-blocking mode we ran temporarily out of data. Signal this
- * to the caller via EWOULDBLOCK and error return (-1). In the
- * other cases we simply return what we got and let the caller
- * wait for more. On the other hand, if we got an EOF we have to
- * convert and flush all waiting partial data.
- */
-
- if (!Tcl_Eof(cd->parent)) {
- /*
- * The state of the seek system is unchanged!
- */
-
- if ((gotBytes == 0) && (cd->flags & ASYNC)) {
- *errorCodePtr = EWOULDBLOCK;
- return -1;
- }
- return gotBytes;
- }
-
+ }
+ if (readBytes == 0) {
/*
- * (Semi-)Eof in parent.
+ * Eof in parent.
*
* Now this is a bit different. The partial data waiting is
* converted and returned.
@@ -3052,12 +3023,6 @@ ZlibTransformInput(
return gotBytes;
}
-
- /*
- * Reset eof, force caller to drain result buffer.
- */
-
- ((Channel *) cd->parent)->state->flags &= ~CHANNEL_EOF;
} else /* readBytes > 0 */ {
/*
* Transform the read chunk, which was not empty. Anything we get