summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
Commit message (Collapse)AuthorAgeFilesLines
...
| | * 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.
| * | * generic/tclIO.c (CopyData): Applied another patch by Alexandreandreas_kupries2008-04-151-6/+8
| | | | | | | | | | | | | | | | | | | | | * io.test (io-53.8a): Ferrieux <ferrieux@users.sourceforge.net>, * chanio.test (chan-io-53.8a): 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
| | | | | | | | | | | | | | | | | | | | | | | | * tests/chanio.test: * 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.
| * | * generic/tclIO.c (CopyData): Applied patch [Bug 1932639] toandreas_kupries2008-04-031-14/+24
| | | | | | | | | | | | | | | | | | * tests/io.test: prevent fcopy from calling -command synchronously * tests/chanio.test: 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.
* | | Make sure [fcopy -size ... -command ...] always calls the callback ↵ferrieux2010-12-101-1/+38
| | | | | | | | | | | | asynchronously, even for size zero.
* | | Missed a spot.dkf2010-03-201-2/+2
| | |
* | | Allow [fcopy] to move more than 2GB per call. Frederic Bonnet identified issue.dkf2010-03-201-38/+48
| | |
* | | * generic/tclIORTrans.c (ReflectInput, ReflectOutput,andreas_kupries2010-03-171-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ReflectSeekWide): [Bug 2921116]: Added missing TclEventuallyFree calls for preserved ReflectedTransform* structures. Reworked ReflectInput to preserve the structure for its whole life, not only in InvokeTclMethod. * generic/tclIO.c (Tcl_GetsObj): [Bug 2921116]: Regenerate topChan, may have been changed by a self-modifying transformation. * tests/ioTrans/test (iortrans-4.8, iortrans-4.9, iortrans-5.11, iortrans-7.4, iortrans-8.3): New test cases.
* | | More tidying up (whitespace, spelling, useless parentheses, useless casts)dkf2010-02-241-37/+45
| | |
* | | * 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.
* | | Killed c99/c++ comments left in by the IO patch.andreas_kupries2009-12-091-6/+1
| | |
* | | * generic/tclIO.c: [Bug 2901998]: Applied Alexandre Ferrieux'sandreas_kupries2009-12-091-5/+48
| | | | | | | | | | | | | | | | | | patch fixing the inconsistent buffered I/O. Tcl's I/O now flushes buffered output before reading, discards buffered input before writing, etc.
* | | Fix [Bug 2849797]: channel name inconsistencies as suggested by DKFnijtmans2009-11-181-5/+11
| | | | | | | | | | | | | | | | | | minor *** POTENTIAL INCOMPATIBILITY *** because Tcl_CreateChannel() and its derivatives, now sometimes ignore their "chanName" argument.
* | | * generic/tclIO.c (CopyData): [Bug 2895565]. Dropped bogosityandreas_kupries2009-11-121-9/+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 forward port from the 8.5 branch.
* | | Fix [Bug 2888099] (close discards ENOSPC error) by saving the errnoferrieux2009-11-101-2/+17
| | | | | | | | | | | | | | | from the first of two FlushChannel()s. Uneasy to test; might need specific channel drivers. Four-hands with aku.
* | | Some small bits of tidying up.dkf2009-11-091-16/+14
| | |
* | | * 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/tclDictObj.c: Updated freeIntRepProc routines sodgp2009-09-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclExecute.c: that they set the typePtr field to * generic/tclIO.c: NULL so that the Tcl_Obj is not left * generic/tclIndexObj.c: in an inconsistent state. * generic/tclInt.h: [Bug 2857044] * generic/tclListObj.c: * generic/tclNamesp.c: * generic/tclOOCall.c: * generic/tclObj.c: * generic/tclPathObj.c: * generic/tclProc.c: * generic/tclRegexp.c: * generic/tclStringObj.c:
* | | * generic/tclExecute.c: fix potential uninitialized variable use anddas2009-09-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclFCmd.c: null dereference flagged by clang static * generic/tclProc.c: analyzer. * generic/tclTimer.c: * generic/tclUtf.c: * generic/tclExecute.c: silence false positives from clang static * generic/tclIO.c: analyzer about potential null dereference. * generic/tclScan.c: * generic/tclCompExpr.c:
* | | * generic/tclIO.c (Tcl_GetChannelHandle): Do not crash forandreas_kupries2009-07-231-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | * generic/tclPipe.c (FileForRedirect): getHandleProc == NULL, this is allowed. Provide a nice error message in the bypass area. Updated caller to check the bypass for a mesage. This fixes the bug [Bug 2826248] reported by Andy Sonnenburg <andy22286@users.sourceforge.net>
* | | - eliminate some unnessary type castsnijtmans2009-02-101-8/+8
| | | | | | | | | | | | | | | - some internal const decorations - spacing
* | | Style fixes (unfouling whitespace, sorting comments, removing useless casts, ↵dkf2009-01-091-33/+31
| | | | | | | | | | | | etc.)