Tcl Source Code

Check-in [9823e74a67]
Login

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

Overview
Comment:Fix bug exposed when buffer recycling is disabled.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 9823e74a67513585e4c621513b8c83476315451d
User & Date: dgp 2014-04-29 16:36:39
Context
2014-04-29
17:40
Make sure no shared ChannelBuffers get recycled. check-in: c101f46322 user: dgp tags: core-8-5-branch
16:47
Fix bug exposed when buffer recycling is disabled. check-in: 84f992ce50 user: dgp tags: trunk
16:36
Fix bug exposed when buffer recycling is disabled. check-in: 9823e74a67 user: dgp tags: core-8-5-branch
15:54
Revise the logic for setting TCL_ENCODING_END in the outputEncodingFlags so it does not rely on buff... Closed-Leaf check-in: bf4b0651be user: dgp tags: dgp-no-buffer-recycle
2014-04-23
18:25
[3493120] Plug memory leak in thread exit. check-in: 18257b2f89 user: dgp tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclIO.c.

3138
3139
3140
3141
3142
3143
3144
3145

3146
3147
3148
3149
3150
3151
3152
    /*
     * When the channel has an escape sequence driven encoding such as
     * iso2022, the terminated escape sequence must write to the buffer.
     */

    stickyError = 0;

    if ((statePtr->encoding != NULL) && (statePtr->curOutPtr != NULL)

	    && (CheckChannelErrors(statePtr, TCL_WRITABLE) == 0)) {
	statePtr->outputEncodingFlags |= TCL_ENCODING_END;
	if (WriteChars(chanPtr, "", 0) < 0) {
	    stickyError = Tcl_GetErrno();
	}

	/*







|
>







3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
    /*
     * When the channel has an escape sequence driven encoding such as
     * iso2022, the terminated escape sequence must write to the buffer.
     */

    stickyError = 0;

    if ((statePtr->encoding != NULL)
	    && !(statePtr->outputEncodingFlags & TCL_ENCODING_START)
	    && (CheckChannelErrors(statePtr, TCL_WRITABLE) == 0)) {
	statePtr->outputEncodingFlags |= TCL_ENCODING_END;
	if (WriteChars(chanPtr, "", 0) < 0) {
	    stickyError = Tcl_GetErrno();
	}

	/*
7326
7327
7328
7329
7330
7331
7332
7333

7334
7335
7336
7337
7338
7339
7340
	}

	/*
	 * When the channel has an escape sequence driven encoding such as
	 * iso2022, the terminated escape sequence must write to the buffer.
	 */

	if ((statePtr->encoding != NULL) && (statePtr->curOutPtr != NULL)

		&& (CheckChannelErrors(statePtr, TCL_WRITABLE) == 0)) {
	    statePtr->outputEncodingFlags |= TCL_ENCODING_END;
	    WriteChars(chanPtr, "", 0);
	}
	Tcl_FreeEncoding(statePtr->encoding);
	statePtr->encoding = encoding;
	statePtr->inputEncodingState = NULL;







|
>







7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
	}

	/*
	 * When the channel has an escape sequence driven encoding such as
	 * iso2022, the terminated escape sequence must write to the buffer.
	 */

	if ((statePtr->encoding != NULL)
		&& !(statePtr->outputEncodingFlags & TCL_ENCODING_START)
		&& (CheckChannelErrors(statePtr, TCL_WRITABLE) == 0)) {
	    statePtr->outputEncodingFlags |= TCL_ENCODING_END;
	    WriteChars(chanPtr, "", 0);
	}
	Tcl_FreeEncoding(statePtr->encoding);
	statePtr->encoding = encoding;
	statePtr->inputEncodingState = NULL;