summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
Commit message (Collapse)AuthorAgeFilesLines
* Make sure SetFooFromAny routines react reasonably when passed a NULL interp.dgp2011-04-211-0/+3
|\
* \ Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-021-2/+0
|\ \ | |/ | | more harm than good. Purged them.
| * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-011-2/+0
| | | | | | more harm than good. Purged them.
| * * generic/tclIO.c (CopyData): [Bug 2895565]. Dropped bogosityandreas_kupries2009-11-121-5/+12
| | | | | | | | | | | | * tests/io.test: which used the number of _written_ bytes or character to update the counters for the read bytes/characters. New test io-53.11. This is a backward port from the 8.5 branch.
| * * generic/tclIO.c (FlushChannel): Skip OutputProc for low-levelandreas_kupries2009-10-231-2/+6
| | | | | | | | | | | | 0-length writes. When closing pipes which have already been closed not skipping leads to spurious SIG_PIPE signals. Reported by Mikhail Teterin <mi+thun@aldan.algebra.com>.
| * * generic/tclIO.c (TclFinalizeIOSubsystem): Revised latest commit todgp2008-12-011-3/+3
| | | | | | | | something that doesn't crash the test suite.
| * * generic/tclIO.c (TclFinalizeIOSubsystem): Applied backport ofandreas_kupries2008-11-251-2/+2
| | | | | | | | | | | | Alexandre Ferrieux's patch for [Bug 2270477] to prevent infinite looping during finalization of channels not bound to interpreters.
| * * generic/tclIO.c: Backport of fix for [Bug 2333466].andreas_kupries2008-11-231-2/+4
| |
| * * win/tclWinChan.c (FileWideSeekProc): Accepted a patch byandreas_kupries2008-05-231-8/+8
| | | | | | | | | | | | | | | | | | | | | | Alexandre Ferrieux <ferrieux@users.sourceforge.net> to fix the [Bug 1965787]. 'tell' now works for locations > 2 GB as well instead of going negative. * generic/tclIO.c (Tcl_SetChannelBufferSize): Accepted a patch by * tests/io.test: Alexandre Ferrieux <ferrieux@users.sourceforge.net> to fix the [Bug 1969953]. Buffersize outside of the supported range are now clipped to nearest boundary instead of ignored.
| * * generic/tclIO.c (CopyData): Applied another patch by Alexandreandreas_kupries2008-04-151-6/+9
| | | | | | | | | | | | | | * io.test (io-53.8a): Ferrieux <ferrieux@users.sourceforge.net>, to shift EOF handling to the async part of the command if a callback is specified, should the channel be at EOF already when fcopy is called. Testcase by myself.
| * * tests/io.test (io-53.10): Testcase for bi-directionaly fcopy.andreas_kupries2008-04-071-27/+39
| | | | | | | | | | | | | | * generic/tclIO.c: Additional changes to data structures for fcopy * generic/tclIO.h: and channels to perform proper cleanup in case of a channel having two background copy operations running as is now possible.
| * * generic/tclIO.c (BUSY_STATE, CheckChannelErrors,andreas_kupries2008-04-071-4/+8
| | | | | | | | | | | | | | | | | | | | | | TclCopyChannel): New macro, and the places using it. This change allows for bi-directional fcopy on channels. Thanks to Alexandre Ferrieux <ferrieux@users.sourceforge.net> for the patch. * tests/io.test (io-53.9): Made test cleanup robust against the possibility of slow process shutdown on Windows. Backported from Kevin Kenny's change to the same test on the 8.5 and head branches.
| * * generic/tclIO.c (CopyData): Applied patch [Bug 1932639] toandreas_kupries2008-04-031-13/+23
| | | | | | | | | | | | * tests/io.test: prevent fcopy from calling -command synchronously the first time. Thanks to Alexandre Ferrieux <ferrieux@users.sourceforge.net> for report and patch.
| * * generic/tclIO.c (CopyData): Applied patch for the fcopy problemandreas_kupries2008-04-021-2/+2
| | | | | | | | | | | | | | [Bug 780533], with many thanks to Alexandre Ferrieux <ferrieux@users.sourceforge.net> for tracking it down and providing a solution. Still have to convert his test script into a proper test case.
| * * generic/tclIO.c: Backport memleak fix in TclFinalizeIOSubsystem.dgp2007-05-241-74/+79
| |
| * * generic/tclIO.c (Tcl_StackChannel): Fixed [SF Tcl Bug 1564642],andreas_kupries2006-09-251-2/+2
| | | | | | | | | | aka coverity #51. Extended loop condition, added checking for NULL to prevent seg.fault.
| * * generic/tclIO.c (Tcl_CreateChannel): allow Tcl std channelhobbs2006-07-101-3/+8
| | | | | | | | inheritance to be #defined out (default remains in).
| * * generic/tclIO.c (ReadChars): Added check and panic andandreas_kupries2006-04-051-2/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commentary to a piece of code which relies on BUFFER_PADDING to create enough space at the beginning of each buffer forthe insertion of partial multi-byte data at the beginning of a buffer. To explain why this code is ok, and as precaution if someone twiddled the BUFFER_PADDING into uselessness. * generic/tclIO.c (ReadChars): [SF Tcl Bug 1462248]. Added code temporarily suppress the use of TCL_ENCODING_END set when eof was reached while the buffer we are converting is not truly the last buffer in the queue. together with the Utf bug below it was possible to completely bollox the buffer data structures, eventually crashing Tcl. * generic/tclEncoding.c (UtfToUtfProc): Fixed problem where the function accessed memory beyond the end of the input buffer. When TCL_ENCODING_END is set and the last bytes of the buffer start a multi-byte sequence. This bug contributed to [SF Tcl Bug 1462248].
| * Invokes TclpFinalizeSockets() as part of the TclFinalizeIOSubsystem() call.vasiljevic2006-03-101-3/+16
| |
| * * generic/tclIO.c: Made several routines tolerant ofdgp2006-02-151-25/+41
| | | | | | | | * generic/tclIOUtil.c: interp == NULL arguments. [Bug 1380662]
| * * generic/tclIO.c (TclFinalizeIOSubsystem): preserve statePtrhobbs2005-11-181-10/+13
| | | | | | | | until we netrieve next statePtr from it.
| * * generic/tclIO.c (TclFinalizeIOSubsystem): Applied Pat Thoyts'andreas_kupries2005-11-181-2/+6
| | | | | | | | | | | | | | patch for [SF Tcl Bug 1359094]. This moves the retrieval of the next channel state to the end of the loop, as the called closeproc may close other channels, i.e. modify the list we are iterating, invalidating any pointer retrieved earlier.
| * Backed off change from 2005-10-04 (see ChangeLog and Tcl Bug# 1323992vasiljevic2005-10-141-14/+2
| | | | | | | | for more info.
| * Added some more clarifying comments in Tcl_ClearChannelHandlers()vasiljevic2005-10-131-6/+5
| |
| * Temporary ifdef TCL_THREADS changes done to de-activate pendingvasiljevic2005-10-131-1/+8
| | | | | | | | event processing when channel is being closed/cutted.
| * Tcl_ClearChannelHandlers(): now deletes any outstandingvasiljevic2005-10-041-2/+14
| | | | | | | | | | timer for the channel. Also, prevents events still in the event queue from triggering on the current channel.
| * bug 1225727Kevin B Kenny2005-06-221-1/+2
| |
| * * generic/tclIO.c (Tcl_SetChannelBufferSize): Lowest size limitdavygrvy2005-04-141-8/+9
| | | | | | | | | | | | | | | | | | | | * tests/io.test: changed from ten bytes to one byte. Need * tests/iogt.test: for this change was proven by Ross Cartlidge <rossc@cisco.com> where [read stdin 1] was grabbing 10 bytes followed by starting a child process that was intended to continue reading from stdin. Even with -buffersize set to one, nine chars were getting lost by the buffersize over reading for the native read() caused by [read].
| * TIP#218 IMPLEMENTATIONandreas_kupries2005-01-271-15/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclDecls.h: Regenerated from tcl.decls. * generic/tclStubInit.c: * doc/CrtChannel.3: Documentation of extended API, * generic/tcl.decls: extended testsuite, and * generic/tcl.h: implementation. Removal of old * generic/tclIO.c: driver-specific TclpCut/Splice * generic/tclInt.h: functions. Replaced with generic * tests/io.test: thread-action calls through the * unix/tclUnixChan.c: new hooks. Update of all builtin * unix/tclUnixPipe.c: channel drivers to version 4. * unix/tclUnixSock.c: Windows drivers extended to * win/tclWinChan.c: manage thread state in a thread * win/tclWinConsole.c: action handler. * win/tclWinPipe.c: * win/tclWinSerial.c: * win/tclWinSock.c: * mac/tclMacChan.c:
| * Fix [Bug 1025359] to make sure wide seeks don't lose errorsdkf2004-09-101-5/+5
| |
| * * generic/tclIO.h (CHANNEL_INCLOSE): New flag. Set inandreas_kupries2004-07-151-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclIO.c (Tcl_UnregisterChannel): 'Tcl_Close' while the * generic/tclIO.c (Tcl_Close): close callbacks are run. Checked in 'Tcl_Close' and 'Tcl_Unregister' to prevent recursive call of 'close' in the close-callbacks. This is a possible error made by implementors of virtual filesystems based on 'tclvfs', thinking that they have to close the channel in the close handler for the filesystem. * generic/tclIO.c: * generic/tclIO.h: * Not reverting, but #ifdef'ing the changes from May 19, 2004 out of the core. This removes the ***POTENTIAL INCOMPATIBILITY*** for channel drivers it introduced. This has become possible due to Expect gaining a BlockModeProc and now handling blockingg and non-blocking modes correctly. Thus [SF Tcl Bug 943274] is still fixed if a recent enough version of Expect is used. * doc/CrtChannel.3: Added warning about usage of a channel without a BlockModeProc.
| * Removed one bogus clearance of the has-more flag. Erroneously keptandreas_kupries2004-05-191-3/+1
| | | | | | | | after shifting the code.
| * * tclIO.c: Fixed [SF Tcl Bug 943274]. This is the same problem asandreas_kupries2004-05-191-6/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | * tclIO.h: [SF Tcl Bug 462317], see ChangeLog entry 2001-09-26. The fix done at that time is incomplete. It is possible to get around it if the actual read operation is defered and not executed in the event handler itself. Instead of tracking if we are in an read caused by a synthesized fileevent we now track if the OS has delivered a true event = actual data and bypass the driver if a read finds that there is no actual data waiting. The flag is cleared by a short or full read.
| * * generic/tclIO.c (Tcl_SetChannelOption): Fixed [SF Tcl Bugandreas_kupries2004-04-231-1/+10
| | | | | | | | | | 930851]. When changing the eofchar we have to zap the related flags to prevent them from prematurely aborting the next read.
| * * generic/tclIO.c (Tcl_Ungets): fixes improper filling of the channel buffer.davygrvy2004-02-021-3/+2
| | | | | | | | [Bug 405995]
| * * generic/tclIO.c (UpdateInterest): When dropping interest inandreas_kupries2003-04-111-7/+38
| | | | | | | | | | | | | | TCL_READABLE now dropping interest in TCL_EXCEPTION too. This fixes a bug where Expect detects eof on a file prematurely on solaris 2.6 and higher. A much more complete explanation is in the code itself (40 lines of comments for a one-line change :)
| * Experimental change. Easier to check in and later back out if thereandreas_kupries2003-04-101-1/+13
| | | | | | | | | | | | are problems than to try and compile everything manually on all the platforms. This way the AS auto-build gets the change without fuss, and I can read the logs tomorrow.
* | [backport] Make sure [fcopy -size ... -command ...] always calls the ↵ferrieux2010-12-101-1/+38
| | | | | | | | callback asynchronously, even for size zero.
* | * generic/tclIO.c (CopyData): Allow the total number of bytes copieddkf2010-03-201-4/+5
| | | | | | | | by [fcopy] to exceed 2GB. Can happen when no -size parameter given.
* | * generic/tclIO.c (CreateScriptRecord): [Bug 2918110]: Initializeandreas_kupries2010-01-181-6/+23
| | | | | | | | | | | | | | | | the EventScriptRecord (esPtr) fully before handing it to Tcl_CreateChannelHandler for registration. Otherwise a reflected channel calling 'chan postevent' (== Tcl_NotifyChannel) in its 'watchProc' will cause the function 'TclChannelEventScriptInvoker' to be run on an uninitialized structure.
* | * generic/tclIO.c (CopyData): [Bug 2895565]. Dropped bogosityandreas_kupries2009-11-121-10/+13
| | | | | | | | | | | | which used the number of _written_ bytes or character to update the counters for the read bytes/characters. See last entry for the test case.
* | Backported fix for [Bug 2888099] (close discards ENOSPC error) byferrieux2009-11-111-2/+15
| | | | | | | | | | saving the errno from the first of two FlushChannel()s. Uneasy to test; might need specific channel drivers. Four-hands with aku.
* | * generic/tclIO.c (FlushChannel): Skip OutputProc for low-levelandreas_kupries2009-10-231-2/+6
| | | | | | | | | | | | 0-length writes. When closing pipes which have already been closed not skipping leads to spurious SIG_PIPE signals. Reported by Mikhail Teterin <mi+thun@aldan.algebra.com>.
* | * generic/tclIO.c: Revised ReadChars and FilterInputBytes routinesdgp2009-10-191-17/+27
| | | | | | | | | | | | | | to permit reads to continue up to the string limits of Tcl values. Before revisions, large read attempts could panic when as little as half the limiting value length was reached. [Patch 2107634] Thanks to Sean Morrison and Bob Parker for their roles in the fix.
* | * generic/tclIO.c (Tcl_GetChannelHandle): [Bug 2826248]: Do not crashandreas_kupries2009-07-241-1/+9
| | | | | | | | | | | | | | | | * generic/tclPipe.c (FileForRedirect): for getHandleProc == NULL, this is allowed. Provide a nice error message in the bypass area. Updated caller to check the bypass for a mesage. Bug reported by Andy Sonnenburg <andy22286@users.sourceforge.net>. Backported from CVS head.
* | * generic/tclIO.c (SetChannelFromAny and related): Modified theandreas_kupries2008-12-111-3/+17
| | | | | | | | | | | | | | | | * tests/io.test: internal representation of the tclChannelType to contain not only the ChannelState pointer, but also a reference to the interpreter it was made in. Invalidate and recompute the internal representation when it is used in a different interpreter (Like cmdName intrep's). Added testcase. [Bug 2407783].
* | * generic/tclIO.c (TclFinalizeIOSubsystem): Replaced Alexandreandreas_kupries2008-12-021-3/+3
| | | | | | | | | | Ferrieux's first patch for [Bug 2270477] with a gentler version, also supplied by him.
* | * generic/tclIO.c (TclFinalizeIOSubsystem): Applied Alexandreandreas_kupries2008-11-251-2/+2
| | | | | | | | | | Ferrieux's patch for [Bug 2270477] to prevent infinite looping during finalization of channels not bound to interpreters.
* | * generic/tclIO.c: Backport of fix for [Bug 2333466].andreas_kupries2008-11-231-2/+5
| |
* | * win/tclWinChan.c (FileWideSeekProc): Accepted a patch byandreas_kupries2008-05-231-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | Alexandre Ferrieux <ferrieux@users.sourceforge.net> to fix the [Bug 1965787]. 'tell' now works for locations > 2 GB as well instead of going negative. * generic/tclIO.c (Tcl_SetChannelBufferSize): Accepted a patch by * tests/io.test: Alexandre Ferrieux <ferrieux@users.sourceforge.net> * tests/chanio.test: to fix the [Bug 1969953]. Buffersize outside of the supported range are now clipped to nearest boundary instead of ignored.