aboutsummaryrefslogtreecommitdiff
path: root/jim-aio.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-20aio: Only allow TCP_NODELAY if sockets are supportedSteve Bennett1-2/+2
Sockets need extra work on Windows, so not supported there yet. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-20aio: Add support for TCP_NODELAYSteve Bennett1-0/+26
Enable or disable Nagle's algorigthm Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-02-13aio: Fix stdio error detectionSteve Bennett1-1/+1
The test for ECONNABORTED was reversed such that errors such as ENXIO did not correctly return an error. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-09Fix C++ compatibilityEvan Hunter1-3/+3
Compiling for C++ (as is needed for Metakit extension) generates an error due to the use of the reserved word 'template' as an argument name. Renaming this argument
2016-10-09Avoid re-defining _GNU_SOURCEEvan Hunter1-0/+2
pkgconfig for SDL causes _GNU_SOURCE to be defined on the commandline, hence causing an error when these source files re-define it.
2016-09-29Add support for "-commands" to many commandsSteve Bennett1-1/+1
This option returns a list of support subcommands and is useful for command line completion. Support added to: socket, namespace, tcl::prefix, string, dict, info Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-09aio: add tty settings support (via termios)Steve Bennett1-1/+58
Enough to make serial ports work and support raw and cooked input/output Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-07jim-intereactive: reduce permissions on saved history fileSteve Bennett1-7/+1
When creating ~/.jim_history, set permissions to 0600 for security Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-20Fix aio locking on non-linux platformsSteve Bennett1-3/+16
And improve the tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-20add POSIX lock/unlock methods to aio objectsHummyPkg1-0/+51
2016-08-17Don't unconditionally define _GNU_SOURCESteve Bennett1-0/+1
Also, fix build if JIM_OPTIMIZATION is disabled Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-17eventloop: Switch to using fd for eventloopSteve Bennett1-3/+3
eventloop doesn't need a filehandle, so so simplify the interface by using file descriptors instead Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-17bootstrap: Add minimal package require supportSteve Bennett1-10/+10
Makes it easier to run the test suite if a minmal 'package require' is supported. Also omit SSL code from jim-aio.c Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-03-27aio: MinGW - Fix compilation errorEvan Hunter1-0/+5
Due to not having support for group or owner permission flags.
2016-02-02aio: Fix crash in aio copySteve Bennett1-1/+1
Fix incorrect check for target as invalid filehandle. e.g. stdin copy blah Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-02-01aio: fix aio ssl supportSteve Bennett1-11/+13
The following changes were not merged: - commit examples/{certificate,key}.pem - return AioFile from JimMakeChannel to allow ssl-specific settings to be set - improve examples/ssl.{client,server} so they work out-of-the-box Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-02-01aio: replace HAVE_SOCKETPAIR with HAVE_DUPDima Krasner1-4/+3
in aio_cmd_ssl()
2016-02-01aio: add error message when SSL verification failsDima Krasner1-1/+11
2016-02-01aio: don't set ssl in make channelSteve Bennett1-17/+14
It is simpler if af->ssl is handled after creating the channel Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-02-01aio: add OpenSSL/LibreSSL bindings.Dima Krasner1-62/+388
Example usage: set s [socket stream.server 127.0.0.1:8443] set c [[$s accept] ssl -server certificate.pem key.pem] puts [$c gets]
2015-09-28Bug fix - channel names are not formattedDima Krasner1-1/+2
2015-03-19aio: add 'sync' subcommandSteve Bennett1-0/+20
If the underlying platform supports fsync(), $handle sync invokes fsync() on the stream file descriptor. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-12-09aio: fix a compiler warning on some platformsSteve Bennett1-0/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-09-18exec: simplify tempfile error msg handlingSteve Bennett1-2/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-09-01aio: consolidate address formattingSteve Bennett1-44/+33
Removes some duplicated code Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-09-01aio: optional argument addrvar for accept.Danyil Bohdan1-2/+26
2014-08-03Temporary file creation should respect $TMPDIRSteve Bennett1-0/+49
This applies to [exec] and [file tempfile] Reported-by: Jakub Wilk Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-04-28aio: Fix conflict between onexception and writableSteve Bennett1-1/+1
onexecption was using the wrong location Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-04-24aio: ignore return code of fcntlSteve Bennett1-2/+2
Keep coverity happy Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-04-23aio: close filehandle after Jim_DeleteFileHandlerSteve Bennett1-4/+5
Avoids a coverity warning Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-23aio: fix open called with wrong number of argumentsAlexander F. Mayer1-1/+3
2014-01-21many comment changes, some small code changesSteve Bennett1-21/+21
Sweep through and clean up all (most) of the comments in the code. While there, adjust some variable and function names to be more consistent, and make a few small code changes - again, mostly for consistency. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15aio: simplify JimMakeChannel()Steve Bennett1-16/+15
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15aio: open |... should use ::popenSteve Bennett1-1/+1
In case not in the global namespace Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15jim-aio: don't bother storing fcntl(F_GETFL)Steve Bennett1-8/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15jim-aio.c: Fix possible compile error for JIM_ANSICSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-03Remove tabs from source filesSteve Bennett1-51/+50
Tabs accidentally crept into source files in violaton of the style guide Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-12-21Fix a couple of minor build issuesSteve Bennett1-0/+3
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-12-21Add support for 'socket pair'Steve Bennett1-25/+51
Creates a pair of bidirectional sockets with socketpair(2) Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-12-21aio: add support for half-closeSteve Bennett1-3/+23
Currently only for sockets since Jim Tcl does not support bidirectional pipes. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-12-09Fix aio close from non-global namespaceSteve Bennett1-3/+5
aio [open], as well as similar commands return the name of the created command. If this is done in the non-global namespace, the returned name is implicitly scoped to the current namespace while the actual command is created in the global namespace. Thus [close] does not work when invoked in that namespace. The solution is to return a fully qualified name, such as ::aio.handle3 Note that this may also be a problem for similar command such as [proc] and [alias] that return command names. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-08-28Fix aio recvfrom for non-inet socketSteve Bennett1-1/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-08-02Fix memory management of aio event handlersSteve Bennett1-10/+7
It was possible for a handler to be deleted (e.g. if the handler threw an error), but the channel handle to still maintain a pointer to the handler script. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-08-02Correct file handler should be deletedSteve Bennett1-11/+3
Previously, Jim_DeleteFileHandler() would indiscriminately delete the first matching file handler in the list. Instead, it should delete the file handler matching the event mask. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2012-09-06aio seek and tell should allow for 64 bit offsetsSteve Bennett1-5/+13
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2012-02-27Add support for aio command: isattySteve Bennett1-0/+19
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2012-02-14Use JIM_WIDE_MAX rather than LLONG_MAXSteve Bennett1-1/+1
For platforms which don't have long long Signed-off-by: Steve Bennett <steveb@workware.net.au>
2012-02-02Allow 'aio copyto' and 'aio read' to copy >2GBSteve Bennett1-9/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au> Reported-by: af123 <jimdevel@hummypkg.org.uk>
2011-12-16Better error/eof detection in aioSteve Bennett1-12/+28
On cygwin, ECONNRESET can happen when the other end closes the connection. Treat it like EOF. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-13aio: Fix a compile problem for JIM_ANSICSteve Bennett1-0/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>