summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
Commit message (Collapse)AuthorAgeFilesLines
* Make simplificiations possible when we know just bytes are getting copieddgp_writebytes_optimizedgp2014-08-211-69/+29
| | | without complications of encodings
* Copy Write() to WriteBytes() to create an arena for performance hacking.dgp2014-08-201-2/+166
|
* Docs for Tcl_CreateChannelHandler() state that the registered handler procaku_reviewdgp2014-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | will be called back with a mask value. "Mask is an integer mask indicating which of the requested conditions actually exists for the channel; it will contain ***a subset of the bits from the mask argument*** to Tcl_CreateChannelHandler when the handler was created." (emhpasis added). Tcl_NotifyChannel is not honoring this. It passes a mask value that may contain bits not in common with the mask argument to T_CCH(). This commit is a one-liner patch adding in the masking step to make things behave as documented. Thanks to apn for digging this out. (In combination with other questionable code, this led to a hang in test http-4.6 on Windows) Tcl_NotifyChannel() has had this error in all of recorded Tcl history. It's hard to imagine any code dependent on it though. If any exists, it can be revised to pass the mask value it truly needs to T_CCH() and end up with code suitable both before and after this change. If you concur, please merge to core-8-5-branch, and I'll take it from there.
* Accommodate the "udp" package, and any other Tcl package that expects adgp2014-08-121-1/+1
| | | | | [read] on a channel @ EOF to attempt another pass through the channel drivers instead of immediately returning an empty string. Correcting this misbehavior appears too disruptive in a patch release to a long stable branch.
* Another Preserve/Release on channels is needed during IO finalization.dgp2014-08-021-0/+3
|
* Updated package "platform" to version 1.0.13. Separated theandreask2014-08-011-1/+1
| | | | | | | | identifiers "macosx*-i386-x86_64" and "macosx-universal" as incompatible with each other. Plus addition of a cast in tclIO.c to match types in a comparison which otherwise bugs a Windows debug build (warnings are errors).
* Backport the cheaper Preserve/Release on channels.dgp2014-08-011-33/+55
|\
| * Complete transformation off Tcl_Preserve() legacy onto ref counting.dgp2014-07-301-15/+7
| |
| * Reduce the cost of Preserve/Release on channelsdgp2014-07-301-25/+52
| |
| * Revise MBRead() to be used in both sync and async modes.dgp2014-07-281-44/+34
| |
| * Push MBWrite() differences out to callers.dgp2014-07-271-27/+22
| |
| * Rework MBWrite() so it can be used in both sync and async modes.dgp2014-07-271-68/+41
| | | | | | Reduce code duplication.
| * Use common MBError() routine for sync and async operations.dgp2014-07-261-25/+24
| |
| * Extend the "move buffer" implementation to cover the async case.dgp2014-07-261-11/+175
| |
| * simplify moveBytes selection logicdgp2014-07-241-3/+1
| |
| * Make sure MoveBytes error reporting reproduces what CopyData does. Bugward ↵dgp2014-07-241-0/+8
| | | | | | | | compatibility!
| * Make sure MoveBytes records read error messages.dgp2014-07-241-1/+5
| |
| * Extend the buffer move optimization to the "same encodings" case.dgp2014-07-231-2/+3
| |
| * merge trunkdgp2014-07-221-1/+1
| |\
| | * Repair buffer indexing error in Tcl_ReadRaw().dgp2014-07-101-1/+1
| | |\ | |_|/ |/| |
| * | First draft of using buffer moves in place of buffer copies to create andgp2014-07-091-2/+117
| |/ | | | | efficient [chan copy].
| * [c31ca233ca] Fix TclGetsObjBinary() so that each [gets] rediscovers whetherdgp2014-07-021-5/+4
| |\ | | | | | | a nonblocking channel is blocked.
| * \ Fix mismatch of Tcl_Preserve() / Tcl_Release().dgp2014-06-261-2/+1
| |\ \
| * \ \ Simplify / refactor Tcl_ReadRaw(). No need for CopyBuffer().dgp2014-06-241-127/+50
| |\ \ \
| * \ \ \ When too many chars are read by ReadChars() and we trim the limits to get it ↵dgp2014-06-051-4/+11
| |\ \ \ \ | | | | | | | | | | | | | | | | | | right on the next pass, don't forget the TCL_UTF_MAX padding demanded by Tcl_ExternalToUtf(). (Thanks for finding that, aku!) Fix the factorPtr management. It was just totaly wrong. The factor should be a ratio of the record of bytes read to the record of chars read. With those fixes, new test io-12.6 covers the "too many chars" code.
| * \ \ \ \ Revise DiscardOutput() to account for revisions to the loop in ↵dgp2014-06-041-0/+5
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | FlushChannel() which is its only caller. We need to discard the curOutPtr buffer as well, and not count on another pass through the loop to attempt to flush it (and raise the same failure again?).
* | | | | | | Repair buffer indexing error in Tcl_ReadRaw() exposed by iogt-6.0 and valgrind.dgp2014-07-101-1/+1
| |_|_|_|_|/ |/| | | | |
* | | | | | [c31ca233ca] Fix TclGetsObjBinary() so that each [gets] rediscovers whetherdgp2014-07-021-5/+4
| |_|_|_|/ |/| | | | | | | | | a nonblocking channel is blocked.
* | | | | Fix mismatch of Tcl_Preserve() / Tcl_Release().dgp2014-06-261-2/+1
| |_|_|/ |/| | |
* | | | Simplify / refactor Tcl_ReadRaw(). No need for CopyBuffer().dgp2014-06-241-127/+50
| |_|/ |/| |
* | | When too many chars are read by ReadChars() and we trim the limits todgp2014-06-051-4/+11
| |/ |/| | | | | | | | | | | get it right on the next pass, don't forget the TCL_UTF_MAX padding demanded by Tcl_ExternalToUtf(). (Thanks for finding that, aku!) Fix the factorPtr management. It was just totaly wrong. The factor should be a ratio of the record of bytes read to the record of chars read. With those fixes, new test io-12.6 covers the "too many chars" code.
* | Revise DiscardOutput() to account for revisions to the loop in FlushChannel()dgp2014-06-041-0/+5
| | | | | | | | | | which is its only caller. We need to discard the curOutPtr buffer as well, and not count on another pass through the loop to attempt to flush it (and raise the same failure again?).
* | Backport I/O core fixes made known by async socket work on trunk.dgp2014-06-031-7/+15
|\ \ | |/
| * These edits make all tests outside of socket-14.* pass on OSX Mavericks.dgp_async_socketdgp2014-06-031-1/+3
| | | | | | | | Several socket-14.* tests failing there, and those that pass are very slow about it. Firewall or poor networking configuration may be playing a role.
| * These edits make the tests socket-14.11.[01] stop hanging, but also introducedgp2014-06-021-6/+12
| | | | | | a whole raft of test failures. WIP.
| * Correct the interest masks in the Tcl_CreateFileHandler() calls in ↵dgp2014-05-311-5/+12
| |\ | | | | | | | | | PipeWatchProc(). When we are interested in both readable and writable events of a command pipeline channel, we only want the readable from the read end of the pipe, and the writable from the write end of the pipe.
| | * Correct the interest masks in the Tcl_CreateFileHandler() calls indgp2014-05-311-5/+12
| |/ |/| | | | | | | PipeWatchProc(). When we are interested in both readable and writable events of a command pipeline channel, we only want the readable from the read end of the pipe, and the writable from the write end of the pipe.
| * Refinements of FlushChannel() and its callers. Notably includes removal of ↵dgp2014-05-291-106/+66
| |\ | |/ |/| | | the flag BUFFER_READY.
| * Fix gcc warning (signed-unsigned compare)jan.nijtmans2014-05-211-1/+1
| |
| *-. Rework the management of the CHANNEL_BLOCKED and CHANNEL_EOF flags, in ↵dgp2014-05-201-137/+139
| |\ \ | | | | | | | | | | | | particular not allowing them to leak between multiple layers of a stacked channel. Much common code refactored into ChanRead().
| | * | Merge flag changes. - Wow, no trouble with [chan push] demonstrated.dgp2014-05-161-39/+37
| | | |
| | * | merge trunkdgp2014-05-161-9/+37
| | |\ \ | | |/ / | |/| |
| | * | Refactored much management of the BLOCKED and EOF flags into ChanRead() thendgp2014-05-131-99/+104
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | began repairing some of the logic about them. Tests iogt-2.* now fail because they've been crafted as experiments recording the fine detail of reflected channel driver calls, and fixing the management of channel flags is changing that. zlib-8.5 also needed adjustment to reflect that an EOF set must come with an empty string read when flags are functioning properly.
| * | \ \ merge 8.5dgp2014-05-161-9/+37
| |\ \ \ \ | | |/ / / | |/| | |
| | | | |
| | \ \ \
| *-. \ \ \ Merge the reforms of dgp-trunk-read branch into trunk. (port of dgp-read-bytes)dgp2014-05-081-812/+552
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Large overhaul of I/O read operations - Protects integer overflow of buffers, reusing append machinery - Forces -buffersize changes to take place when commanded - Uses assertions to simplify code in "can't happen" situations - Eliminated duplication of -translation processing - Fixes bugs io-35.18b and io-35.20
| | * \ \ \ \ merge trunkdgp2014-05-081-8/+3
| | |\ \ \ \ \ | | |/ / / / / | |/| | | | |
| | * | | | | merge trunkdgp2014-05-081-1/+12
| | |\ \ \ \ \
| | * \ \ \ \ \ merge trunkdgp2014-05-021-14/+42
| | |\ \ \ \ \ \
| | * \ \ \ \ \ \ merge trunkdgp2014-05-011-10/+31
| | |\ \ \ \ \ \ \
| | * \ \ \ \ \ \ \ merge trunkdgp2014-04-211-8/+42
| | |\ \ \ \ \ \ \ \