Tcl Source Code

Check-in [5134ecb54a]
Login

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

Overview
Comment:Added comments raising questions about possible updates to channel drivers on Windows.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5134ecb54aab44b98633b99dea4a144d2053a8ab
User & Date: dgp 2014-03-21 17:11:32
Context
2014-03-26
14:38
Implement RFE [b42b208ba4]: file attributes -readonly (and -archive, -hidden, -system) on Cygwin. check-in: 5656978163 user: jan.nijtmans tags: trunk
10:37
Implementation of [b42b208ba4]: file attributes -readonly on Cygwin. For completeness, implemented -... check-in: 71d7e7db09 user: jan.nijtmans tags: rfe-b42b208ba4
2014-03-23
20:59
Merge the checkins of the dgp-read-bytes branch onto the trunk, up to and including checkin a1e82fb6... check-in: c4c1cd81e4 user: dgp tags: dgp-trunk-read
2014-03-21
19:07
Correct some faulty assumptions in the zlib transformation input driver.

BRANCHED - some other EO... Closed-Leaf check-in: dfadac1b71 user: dgp tags: dgp-eof

17:11
Added comments raising questions about possible updates to channel drivers on Windows. check-in: 5134ecb54a user: dgp tags: trunk
2014-03-20
10:10
Fix [2f7cbd01c3]: tcl8.6.1 fails to build on FreeBSD 10.0 check-in: 2c5beb4f45 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to win/tclWinChan.c.

658
659
660
661
662
663
664




665
666
667
668
669
670
671
{
    FileInfo *infoPtr = instanceData;
    DWORD bytesRead;

    *errorCode = 0;

    /*




     * Note that we will block on reads from a console buffer until a full
     * line has been entered. The only way I know of to get around this is to
     * write a console driver. We should probably do this at some point, but
     * for now, we just block. The same problem exists for files being read
     * over the network.
     */








>
>
>
>







658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
{
    FileInfo *infoPtr = instanceData;
    DWORD bytesRead;

    *errorCode = 0;

    /*
     * TODO: This comment appears to be out of date.  We *do* have a
     * console driver, over in tclWinConsole.c.  After some Windows
     * developer confirms, this comment should be revised.
     *
     * Note that we will block on reads from a console buffer until a full
     * line has been entered. The only way I know of to get around this is to
     * write a console driver. We should probably do this at some point, but
     * for now, we just block. The same problem exists for files being read
     * over the network.
     */

Changes to win/tclWinConsole.c.

752
753
754
755
756
757
758







759
760
761
762
763
764
765
     * Attempt to read bufSize bytes. The read will return immediately if
     * there is any data available. Otherwise it will block until at least one
     * byte is available or an EOF occurs.
     */

    if (ReadConsoleBytes(infoPtr->handle, (LPVOID) buf, (DWORD) bufSize,
	    &count) == TRUE) {







	buf[count] = '\0';
	return count;
    }

    return -1;
}








>
>
>
>
>
>
>







752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
     * Attempt to read bufSize bytes. The read will return immediately if
     * there is any data available. Otherwise it will block until at least one
     * byte is available or an EOF occurs.
     */

    if (ReadConsoleBytes(infoPtr->handle, (LPVOID) buf, (DWORD) bufSize,
	    &count) == TRUE) {
	/*
	 * TODO: This potentially writes beyond the limits specified
	 * by the caller.  In practice this is harmless, since all writes
	 * are into ChannelBuffers, and those have padding, but still
	 * ought to remove this, unless some Windows wizard can give
	 * a reason not to.  
	 */
	buf[count] = '\0';
	return count;
    }

    return -1;
}


Changes to win/tclWinPipe.c.

77
78
79
80
81
82
83






84
85
86
87
88
89
90
/*
 * Bit masks used in the sharedFlags field of the PipeInfo structure below.
 */

#define PIPE_EOF	(1<<2)	/* Pipe has reached EOF. */
#define PIPE_EXTRABYTE	(1<<3)	/* The reader thread has consumed one byte. */







/*
 * This structure describes per-instance data for a pipe based channel.
 */

typedef struct PipeInfo {
    struct PipeInfo *nextPtr;	/* Pointer to next registered pipe. */
    Tcl_Channel channel;	/* Pointer to channel structure. */







>
>
>
>
>
>







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
 * Bit masks used in the sharedFlags field of the PipeInfo structure below.
 */

#define PIPE_EOF	(1<<2)	/* Pipe has reached EOF. */
#define PIPE_EXTRABYTE	(1<<3)	/* The reader thread has consumed one byte. */

/*
 * TODO: It appears the whole EXTRABYTE machinery is in place to support
 * outdated Win 95 systems.  If this can be confirmed, much code can be
 * deleted.
 */

/*
 * This structure describes per-instance data for a pipe based channel.
 */

typedef struct PipeInfo {
    struct PipeInfo *nextPtr;	/* Pointer to next registered pipe. */
    Tcl_Channel channel;	/* Pointer to channel structure. */