aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-05-06aio: ssl: Allow SNI to be specifiedSteve Bennett5-63/+88
For some SSL connections it is necessary to set the Server Name Indication in the connection in order to receive the correct certificate. Allow this as part of the client ssl call with: $sock ssl -sni $servername Also for -server mode, allow the certificate and private key to be stored in a single file and only be specified once. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-06aio: Fix eventloop and eof for ssl connectionsSteve Bennett4-44/+131
We can't use feof() and 'buffering none' on ssl connections. Instead we have to get eof from the ssl layer, and provide special handling for buffering in the eventloop. For eof, add ssl_eof() and detect SSL_read() results that indicate eof to set AIO_EOF in flags. For buffering, add 'read -pending' that will read, and then immediately read any buffered data so that the 'readable' event will trigger next time. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-06tests: add ssl.testSteve Bennett3-0/+168
Note that there is currently a problem with ssl and readable events Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-06tests: add socket.testsSteve Bennett1-0/+367
Basic testing of each of the socket types Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-06tests/runall.tcl: support tests that forkSteve Bennett1-0/+7
Because we use catch -exit { ... }, if a test uses os.fork we will return in both the parent in the child. To fix this, require the child to use exit 99, and detect this case and exit from the child in this case. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-06exit: Set the exit code as the interp resultSteve Bennett3-3/+4
If exit is caught with catch -exit, it is currently not possible to retrieve the exit value. If an exit code is provided, set it as the interp result. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-05file: stat: Fixes for 64 bit times on WindowsSteve Bennett2-28/+36
While -D__MINGW_USE_VC2005_COMPAT enables a 64-bit time_t, it is necessary to explicitly use _stat64 to access the stat structure containing 64 bit times. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04tests: Fixes to recent tests for windowsSteve Bennett7-20/+34
Mostly just avoiding running certain tests, but also: - rename() won't overwrite an existing file on Windows - ensure that eof returns 0 or 1 - in aio.test, create and read the file in binary mode Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04jim.c: Fix UpdateStringOfIndex()Steve Bennett2-1/+9
In case the index is invalid, the string should contain -MAX_INT Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04exec: remove useless initialisationSteve Bennett1-3/+0
numPids is always zero here so the code does nothing Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04aio: Improve ipv6 error messageSteve Bennett1-1/+1
To show both the host and port Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04scan: Fix a utf-8 bug for string lengthSteve Bennett2-12/+20
The string length was being checked in chars instead of bytes Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04regsub: Fix regsub -all with \ASteve Bennett3-11/+18
regsub -all matches \A against the start of each match, but correctly handle a pattern like ^ which does not advance the match Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04regexp: Improved error messageSteve Bennett3-9/+23
Detect and produce an error for missing closing bracket ] Consider a trailing backslash as an invalid escape Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04signal check: fix error returnSteve Bennett2-5/+3
If the signal is invalid, indicate that Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04unpack: consistent error messagesSteve Bennett2-23/+17
between pack and unpack Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04file readlink: change error message to match TclSteve Bennett2-2/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04file: rootname, dirname fixes to match TclSteve Bennett2-9/+16
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04tests: Add many new additional tests for code coverageSteve Bennett24-52/+1589
readdir, tty, utf8, signal, alarm, kill, file, jimsh, posix, aio, history, interp, pack, unpack, eventloop, exec, load, package, regexp, regsub Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04aio: remove leftover debuggingSteve Bennett1-1/+0
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04build: Improve coverage supportSteve Bennett2-7/+22
Disable optimisation during coverage. Set CCACHE_DISABLE=1 in the environment, just to be sure to disable ccache Also cleanup coverage files in subdirs too Add support for both lcov and gcovr Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-28tests: namespace.testSteve Bennett1-0/+25
More namespace tests from Evan Hunter Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-28tests: debug.testEvan Hunter2-12/+128
Also requires fixing 'debug' command so that the interpreter & tcltest.tcl can tell it is not supported. And the result of 'debug show' is now returned as the interpreter result rather than being printed.
2020-04-28jim.c: Fix malloc -> Jim_AllocSteve Bennett1-1/+1
The expression tree nodes are freed with Jim_Free and should be allocated with Jim_Alloc Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17tests: file tempfile: don't do path/template tests on windowsSteve Bennett1-3/+8
As Windows doesn't respect the path/template Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17tests: improve code coverageSteve Bennett6-0/+175
- clock - array - file tempfile - lreverse - string byterange - aio tty Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17tcltest: Add support for the -template optionSteve Bennett1-6/+38
When set, failed tests output a complete test command that would succeed. This is useful when creating new tests. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17local, rename: don't allow renaming a local proc with upcallSteve Bennett2-10/+37
If an existing command was replaced when using local proc ..., then renaming the command will break upcall from within the proc because the command no longer exists in the namespace. To prevent this case, disallow rename of such a command. It is still OK to delete with rename <cmd> "" Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17parsing: Fix error with missing quoteSteve Bennett2-0/+24
If a quote is missing inside a command, e.g.["command here] the error should indicate that a quote is missing, not a bracket. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17env: Fix error in case of too many argumentsSteve Bennett2-1/+16
Should produce an error, but did not previously Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17build: Add ./configure --coverageSteve Bennett3-2/+41
To make it easier to generate code coverage output. Ensure that gcovr is installed, then do: ./configure --coverage make test coverage And see the report in coverage.html Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17apply: ignore the current namespaceSteve Bennett2-24/+25
If a namespace is given, it is relative to the global namespace not the current namespace. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17expr: avoid memory leak due to shimmeringSteve Bennett2-7/+29
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17package: add package names as an alias for package listSteve Bennett2-3/+16
Use the same name for this subcommand as Tcl. For now we keep the existing package list in case it is in use. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-02tailcall: Fix to avoid tailcalls consuming C stack framesSteve Bennett3-53/+75
The purpose of a tailcall is to avoid using additional stack frames, however although were were not creating an extra Tcl callframe we were using C stack frames through the call sequence: JimCallProcedure -> Jim_EvalObjList -> JimInvokeCommand -> JimCallProcedure This meant that a large number of tailcalls would overflow the stack. Instead we need to have JimCallProcedure return to JimInvokeCommand where the tailcall can be handled by a subsequent call to JimCallProcedure. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-03-05build: Check for 32-bit time_t at configure timeSteve Bennett3-8/+17
To warn of Y2038 problems, and suggest use of -D__MINGW_USE_VC2005_COMPAT on mingw32. Do this instead of the previous runtime test. Add -D__MINGW_USE_VC2005_COMPAT to the appveyor build. Fixes msteveb/jimtcl#145 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-03-05jim.h: Change type of interp->lastCollectTimeSteve Bennett2-7/+7
Previously we stored lastCollectTime as time_t, but to support more easily enabling 64 bit vs 32 bit time_t, convert this to be JimClock() compatible (64 bit milliseconds). Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-03-05docs: Updates mainly to clarify glob string matchingSteve Bennett1-83/+88
With some additional minor cleanups Fixes msteveb/jimtcl#143 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-03-04clock: test and doc non-Y2038 complianceSteve Bennett2-0/+8
Add a note in the documentation for clock that some systems use 32-bit time_t and are thus not year 2038 compliant. Also add a test to catch this in clock.test Reported-by: dbohdan <dbohdan@dbohdan.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-02-18docs: fix minor typosAntonio Borneo6-17/+17
Fix few typos in the documentation Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-02-18exec: fix valgrind warning on close(-1)Antonio Borneo1-2/+2
When executing "exec.test" under valgrind, it reports several warning messages Warning: invalid file descriptor -1 in syscall close() Add proper check around close() Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-02-13build: examples.api: Add necessary linker flagsSteve Bennett2-1/+3
Linking with -ljim may need additional libraries Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-02-06Fix #148 - oo errors with no class variables.TheMarkitecht1-1/+1
https://github.com/msteveb/jimtcl/issues/148
2020-01-22docs: make it clear that the package version is ignoredSteve Bennett1-3/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-12-30regexp: Reset scanner position on failed optional groupSteve Bennett2-0/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-12-13tests: Fix misc.test for new return -level 0 behaviourSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-12-13return: fix -level 0 -code xxxSteve Bennett2-3/+10
Should return the given return code, not JIM_RETURN (2) Reported-by: dbohdan <dbohdan@dbohdan.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-11-30jimsh: interactive mode: print nullsSteve Bennett2-2/+6
If the interp result contains embedded nulls, print the full result. Reported-by: dbohdan <dbohdan@dbohdan.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-11-30string map and string compare now support embedded nullsSteve Bennett4-64/+76
Reported-by: dbohdan <dbohdan@dbohdan.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-11-20bump version to 0.790.79Steve Bennett3-880/+1079
Update documentation to indicate v0.79 and update Tcl_shipped.html Signed-off-by: Steve Bennett <steveb@workware.net.au>