diff options
| author | dgp@users.sourceforge.net <dgp> | 2014-05-19 18:29:26 (GMT) | 
|---|---|---|
| committer | dgp@users.sourceforge.net <dgp> | 2014-05-19 18:29:26 (GMT) | 
| commit | 7ec3b38d91d02e8f15e17e7ed7919a66af5eb378 (patch) | |
| tree | bc6f072ca2419f0e592243a4e5fc5d9f2b544a9e /generic/tclZlib.c | |
| parent | 6bbd7dc1ec7a4808741709ee36a5685532dad80b (diff) | |
| download | tcl-7ec3b38d91d02e8f15e17e7ed7919a66af5eb378.zip tcl-7ec3b38d91d02e8f15e17e7ed7919a66af5eb378.tar.gz tcl-7ec3b38d91d02e8f15e17e7ed7919a66af5eb378.tar.bz2 | |
Same improvements to the zlib transform operations.
Diffstat (limited to 'generic/tclZlib.c')
| -rw-r--r-- | generic/tclZlib.c | 45 | 
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 | 
