Tcl Source Code

Check-in [80673ea3d1]
Login
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merge 8.7
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 80673ea3d13f63d9bc2f28107b611b2b311cbe5ce383c0160dc8da76758e5b6c
User & Date: jan.nijtmans 2020-06-25 13:02:52
Context
2020-06-28
15:20
Merge 8.7 check-in: 8b76b3fb11 user: jan.nijtmans tags: trunk
2020-06-25
13:02
Merge 8.7 check-in: 80673ea3d1 user: jan.nijtmans tags: trunk
13:01
Merge 8.6 check-in: c60ae5b315 user: jan.nijtmans tags: core-8-branch
11:31
Merge 8.7 check-in: d389b76b8c user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclZlib.c.

3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
....
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
    	unsigned int n; int decBytes;

	/* if starting from scratch or continuation after full decompression */
	if (!cd->inStream.avail_in) {
	    /* buffer to start, we can read to whole available buffer */
	    cd->inStream.next_in = (Bytef *) cd->inBuffer;
	}
	/* 
	 * If done - no read needed anymore, check we have to copy rest of
	 * decompressed data, otherwise return with size (or 0 for Eof)
	 */
	if (cd->flags & STREAM_DECOMPRESS) {
	    goto copyDecompressed;
	}
	/*
................................................................................
	    if (!gotBytes && !(cd->flags & STREAM_DONE)) {
		/* if no-data, but not ready - avoid signaling Eof,
		 * continue in blocking mode, otherwise EAGAIN */
		if (Tcl_InputBlocked(cd->parent)) {
		    continue;
		}
		*errorCodePtr = EAGAIN;
		return -1;		
	    }
	    break;
	}

	/*
	 * Loop until the request is satisfied (or no data available from
	 * above, possibly EOF).







|







 







|







3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
....
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
    	unsigned int n; int decBytes;

	/* if starting from scratch or continuation after full decompression */
	if (!cd->inStream.avail_in) {
	    /* buffer to start, we can read to whole available buffer */
	    cd->inStream.next_in = (Bytef *) cd->inBuffer;
	}
	/*
	 * If done - no read needed anymore, check we have to copy rest of
	 * decompressed data, otherwise return with size (or 0 for Eof)
	 */
	if (cd->flags & STREAM_DECOMPRESS) {
	    goto copyDecompressed;
	}
	/*
................................................................................
	    if (!gotBytes && !(cd->flags & STREAM_DONE)) {
		/* if no-data, but not ready - avoid signaling Eof,
		 * continue in blocking mode, otherwise EAGAIN */
		if (Tcl_InputBlocked(cd->parent)) {
		    continue;
		}
		*errorCodePtr = EAGAIN;
		return -1;
	    }
	    break;
	}

	/*
	 * Loop until the request is satisfied (or no data available from
	 * above, possibly EOF).

Changes to tests/zlib.test.

1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
....
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
    set pathout [makeFile {} test-zlib-13.deflated]
    set chanout [open $pathout wb]
    zlib push inflate $chanin
    fcopy $chanin $chanout
    close $chanin
    close $chanout
} -body {
    file size $pathout    
} -cleanup {
    removeFile $pathout
    unset chanin pathin chanout pathout
} -result 458752

test zlib-13.2 {Ticket [f70ce1fead] - zlib multi-stream expansion} -constraints zlib -setup {
    # Start from the basic asset
................................................................................
    close $chanout
    # Decode second stream
    set chanout [open $pathout2 wb]
    zlib push inflate $chanin
    fcopy $chanin $chanout
    chan pop $chanin
    close $chanout
    #    
    list [file size $pathout1] [file size $pathout2]
} -cleanup {
    close $chanin
    removeFile $pathout
    removeFile $pathout1
    removeFile $pathout2
    unset chanin pathin chanout pathout pathout1 pathout2







|







 







|







1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
....
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
    set pathout [makeFile {} test-zlib-13.deflated]
    set chanout [open $pathout wb]
    zlib push inflate $chanin
    fcopy $chanin $chanout
    close $chanin
    close $chanout
} -body {
    file size $pathout
} -cleanup {
    removeFile $pathout
    unset chanin pathin chanout pathout
} -result 458752

test zlib-13.2 {Ticket [f70ce1fead] - zlib multi-stream expansion} -constraints zlib -setup {
    # Start from the basic asset
................................................................................
    close $chanout
    # Decode second stream
    set chanout [open $pathout2 wb]
    zlib push inflate $chanin
    fcopy $chanin $chanout
    chan pop $chanin
    close $chanout
    #
    list [file size $pathout1] [file size $pathout2]
} -cleanup {
    close $chanin
    removeFile $pathout
    removeFile $pathout1
    removeFile $pathout2
    unset chanin pathin chanout pathout pathout1 pathout2