| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
* socket.c (sock_accept): The address length passed to
recvfrom was not initialized to the storage length.
|
|
|
|
|
|
| |
* tests/014/dgram-stream.tl: New file.
* tests/014/dgram-stream.expected: New file.
|
|
|
|
| |
* txr.1: Syntax issue.
|
|
|
|
|
|
|
|
|
|
| |
* Makefile: suppress --gc-debug for tst/tests/014 directory.
* tests/014/socket-basic.tl: New file.
* tests/014/socket-basic.expected: New file.
* tests/sock-common.tl: New file.
|
|
|
|
|
|
|
|
| |
* socket.c (dgram_set_sock_peer): Assign to struct
dgram_stream using using set macro.
* stream.c (stdio_set_sock_peer): Assign to struct
stdio_handle peer using set macro.
|
|
|
|
|
|
|
| |
* parser.l (yyerrprepf): Replace wrong bare assignment
to parser->prepared_msg with proper set macro which
handles the mutation of a mature generation object
such that it points to a baby object.
|
|
|
|
|
| |
* socket.c (sock_connect): If connect fails, show socket and
address in error message.
|
|
|
|
|
|
|
| |
* stream.c (errno_to_string): Fix wrong test; it is a nil
value of err which is the "no error" case, not non-nil.
Due to this bug, any non-numeric error condition will
be reported as "no error", including the case t ("eof").
|
|
|
|
|
| |
* sysif.c (repress_called, is_setuid): Change to unsigned int,
so comparison with RC_MAGIC constant doesn't elicit warning
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* socket.c (struct dgram_stream): New struct.
(make_dgram_sock_stream, dgram_print, dgram_mark,
dgram_destroy, dgram_overflow, dgram_put_byte_callback,
dgram_put_string, dgram_put_char, dgram_put_byte,
dgram_get_byte_callback, dgram_get_char, dgram_get_byte,
dgram_unget_char, dgram_unget_byte, dgram_flush, dgram_close,
dgram_get_prop, dgram_get_fd, dgram_get_sock_family,
dgram_get_sock_type, dgram_get_sock_peer,
dgram_set_sock_peer, dgram_get_error, dgram_get_error_str,
dgram_clear_error): New static functions.
(dgram_strm_ops): New static structure.
(sock_listen): Check against datagram sockets which have
a peer; otherwise a no-op for datagram sockets.
(sock_accept): Special logic for dgram sockets.
(open_sockfd): Function moved here from stream.c, and
augmented to open dgram stream for dgram sockets.
(open_socket): Function moved here from stream.c.
(sock_load_init): Fill in some operations in dgram_strm_ops.
* stream.c (generic_get_line, make_sock_stream,
errno_to_string): Statics become external.
(open_sockfd, open_socket): Functions removed from here,
moved to socket.c.
* stream.h (generic_get_line, make_sock_stream,
errno_to_string): Declared.
|
|
|
|
|
|
| |
* socket.c (sock_bind, sock_connect, sock_listen): Report
function name as sock-bind, sock-connect and sock-listen,
rather than bind, connect and listen.
|
|
|
|
|
|
| |
* stream.c (get_string): Use default_arg_strict instead
of default_arg, so that the t value is only substituted for a
missing argument, not for a nil argument.
|
|
|
|
|
|
| |
* stream.c (stdio_unget_char): Remove not-a-character check
from character argument.
(unget_char): Perform check here, thus for all stream types.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (unimpl_get_fd, null_get_fd): New static functions.
(fill_stream_ops): Set up get_fd function pointer in
strm_ops.
(null_ops): Add null_get_fd.
(stdio_get_fd): New static function.
(stdio_ops, tail_ops, pipe_ops): Specify stdio_get_fd as get_fd
function.
(stream_fd): Rewritten as call to get_fd operation.
(dir_ops, string_in_ops, byte_in_ops, string_out_ops,
strlist_out_ops, cat_stream_ops): Specify null as get_fd
function, to be defaulted by fill_stream_ops.
(delegate_get_fd): New static function.
(record_adapter_ops): Specify delegate_get_fd as get_fd
function.
(stream_init): Change fileno intrinsic registration to point
to stream_fd function.
* stream.h (struct strm_ops): New member, get_fd.
(strm_ops_init): New macro parameter, get_fd.
* syslog.c (syslog_strm_ops): Specify null as get_fd
function.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (struct stdio_mode, stdio_mode_init_trivial):
Struct declaration and macro removed from here; moved into
stream.h.
(normalize_mode, set_mode_props): Static functions made
external.
* stream.h (struct stdio_mode, stdio_mode_init_trivial): Moved
here.
(normalize_mode, set_mode_props): Declared.
|
|
|
|
|
|
|
| |
* lib.c (bounding_pow_two): Eliminate bogus zero versus
non-zero case check in return which causes the function
to wrongly map 1 to 0, so that chk_manage_vec is then
not able to adjust a vector to size 1.
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (snarf_line): Function renamed to generic_get_line.
Interface and implementation changed so it can be used
directly as get_line virtual.
(stdio_get_line): Function removed.
(stdio_ops, pipe_ops): Point get_line to generic_get_line.
(tail_get_line): Call generic_get_line instead of
stdio_get_line.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (unimpl_get_sock_family, unimpl_get_sock_type,
unimpl_get_sock_peer, unimpl_set_sock_peer): New static
functions.
(fill_stream_ops): Set new function pointers in struct
strm_ops to point to the unimpl_* functions.
(stdio_get_sock_family, stdio_get_sock_type,
stdio_get_sock_peer, stdio_set_sock_peer): New static
functions.
(stdio_sock_ops): New static structure.
(make_sock_stream): Use stdio_sock_ops for socket object.
(sock_family, sock_type, sock_peer, sock_set_peer): These API
functions now just call their corresponding virtuals.
(stream_init): Set up stdio_sock_ops as a copy of stdio_ops,
and then override the socket-specific virtuals from the
unimpl_* stubs to the stdio_get_sock_* and stdio_set_sock_*
functions.
* stream.h (struct strm_ops): New members, get_sock_family,
get_sock_type, get_sock_peer and set_sock_peer.
(strm_ops_init): Set new members to zero.
|
|
|
|
|
|
|
| |
* stream.c (make_sock_stream): External function becomes
static; it is not used outside of this source file.
* stream.h (make_sock_stream): Declaration removed.
|
|
|
|
|
|
|
| |
* sysif.c (umask_wrap): New function.
(sysif_init): Register umask intrinsic.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* inst.nsi: include .tl files in installer
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/socket.tl (sys:str-inaddr-net-impl): New
argument weff. Overrides prefix. Bugfix here: we must
base the number of octets on the calculated width before
wextra is added to it.
(str-inaddr-net, str-inaddr6-net): New optional width
argument.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/socket.tl (sys:in6addr-condensed-text): New
function containing common code. Uses window-mappend to
selectively convert a compressed range of zeros to either
colon or empty string based on whether it is in the middle
or end.
(str-in6addr, str-in6addr-net): Use new function.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (sock_set_entries): Autload entries for
str-inaddr-net and str-in6addr-net.
* share/txr/stdlib/socket.tl (str-inaddr-net,
str-in6addr-net): New functions.
* txr.1: Documented str-inaddr, str-in6-addr,
str-inaddr-net and str-in6addr-net.
|
|
|
|
|
|
|
|
| |
* lisplib.c (sock_set_entries): Add str-inaddr and str-in6addr
to list of autoload identifiers.
* share/txr/stdlib/socket.tl (str-inaddr, str-in6addr): New
functions.
|
|
|
|
|
| |
* eval.c (op_each): Use list_collect_append not
list_collect_nconc. Ouch!
|
|
|
|
|
|
|
|
| |
* eval.c (expand_left, nexpand_left): New static functions.
(eval_init): Registered expand-left and nexpand-left
intrinsics.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* match.c (v_next): If argument to @(next) is nil, then
evaluate remaining query in context with no list of files,
and no data.
* txr.1: Documented @(next nil).
|
|
|
|
|
| |
* sysif.h (repress_privilege, drop_privilege): Add missing
void.
|
|
|
|
| |
* configure: it's, not its.
|
|
|
|
|
|
| |
* txr.1: Refer to parameter as options, not option,
and use .meta consistently. Don't refer to Syslog section in
all caps.
|
|
|
|
| |
* txr.1: replace nonexistent @(elsif) in example with @(elif).
|
|
|
|
| |
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (struct stdio_handle): New member, peer.
(stdio_stream_mark): Mark the new member.
(sock_peer, sock_set_peer): New functions.
(stream_init): Registered sock-peer intrinsic.
* stream.h (sock_peer, sock_set_peer): Declared.
* socket.c (sock_connect): If the connect is successful,
then store the address into the stream as the peer.
|
|
|
|
|
| |
* socket.c (sock_bind): Set the SO_REUSEADDR option before
binding the socket, to thwart the EADDRINUSE nuisance.
|
|
|
|
|
| |
* stream.c (open_fileno): If w_fdopen fails, close the
file descriptor before throwing exception.
|
|
|
|
| |
* stream.c (open_fileno): clear errno to 0 before fdopen.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* socket.c, socket.h: New files.
* Makefile: include new socket.o among objects if have_objects
variable is defined to 'y'.
* configure (have_sockets): New variable. New configure test
for socket-related functionality.
(HAVE_SOCKETS, HAVE_GETADDRINFO): New configuration
preprocessor symbols.
Also, reordering the shell probing so that /usr/xpg4/bin/sh
is the last fallback. On Solaris, it chokes on some code
that is needed for Solaris.
* lisplib.c (sock_set_entries, sock_instantiate): New static
functions.
(lisplib_init): Register new functions as autoload hooks.
* share/txr/stdlib/socket.tl: New file.
* stream.c (socket_error_s): New symbol variable.
(struct stdio_handle): New members, family and type, helping
stdio streams represent sockets too.
(stdio_stream_mark): Mark new members of struct stdio_handle.
(make_stdio_stream_common): Initialize new members.
(make_sock_stream, stream_fd, sock_family, sock_type,
open_socket, open_sockfd): New functions.
(stream_init): Initialize socket_error_s variable. Register
sock-family, sock-type and open-socket intrinsic functions.
Register socket-error subtype.
* stream.h (socket_error_s, make_sock_stream, stream_fd,
sock_family, sock_type, open_socket, open_sockfd):
Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (subtypep): Handle subtype check here between
stream and stdio-stream as a special case, since streams
aren't structures related by inheritance, but built-ins.
(class_check): If the type of obj doesn't match the class
exactly, use a subtypep check. We need this because stream
functions use this check, and stdio streams are not of the
stream type now.
* stream.c (stdio_stream_s): New global symbol variable.
(make_stdio_stream_common): Use stdio_stream_s symbol for the
type of stdio streams.
(stream_init): Intern the stdio-stream symbol, and store in
stdio_stream_s variable.
(streamp): Replace exact check with typep.
* stream.h (stdio_stream_s): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions convert between positive integers, and
fixed-size memory buffers representing pure binary numbers in
big endian byte order.
This functionality will be used in some upcoming networking
code.
* arith.c (num_from_buffer, num_to_buffer): New functions.
* arith.h (num_from_buffer, num_to_buffer): Declared.
* mpi/mpi.c (mp_to_unsigned_buf): New function.
* mpi/mpi.h (mp_to_unsigned_buf): Declared.
|
|
|
|
|
|
| |
* txr.c (txr_main): Implement --eargs.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* struct.c (make_struct_type): Use find_struct_type rather
than direct lookup in struct_type_hash.
(find_struct_type): Use lisplib_try_load if a type is
not found to trigger autoloading on the symbol.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (orig_euid, real_uid, repress_called, is_setuid):
New static variables.
(repress_privilege, drop_privilage, simulate_setuid):
New functions.
(RC_MAGIC): New preprocessor symbol.
* sysif.c (repress_privilege, drop_privilage,
simulate_setuid): Declared.
* txr.c (txr_main): Call repress_privilege to check
and remember whether we are in setuid mode, and temporarily
drop the effective uid to the real one.
(txr_main): Permanently drop privileges in all cases except
script execution. In script execution cases, go through
simulate_setuid to either set or preserve the effective
user ID, or else drop privs.
* txr.1: Documented setuid operation in new section.
|
|
|
|
| |
* match.c (v_require): Produce trace when require fails.
|
|
|
|
|
|
|
|
|
| |
I caught this when doing a @(require (boundp 'var)).
* match.c (v_require): The correct evaluation was being
done here, with the value discarded, followed by an incorrect
evaluation in which the TXR bindings are not visible, whose
value *is* then used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (unhandled_ex): New static structure.
(unwind_to_exit_point): The code to print the unhandled exception info
and bail the process is moved here out of uw_throw. We do this in the
situation when we have an unhandled exception, which is represented
by the fact that the exception pointer points to the unhandled_ex
structure.
(uw_throw): If unhandled hook isn't a function, we don't abort; we go
through the unwinding and unhandled processing. Also, ditto if the
unhandled function returns, ditto. Unhandled processing is entered
by substituting unhandled_ex for the not-found exception, and
allowing unwind_to_exit point to be called.
* txr.1: Document new behavior for unhandled exceptions
and *unhandled-hook*.
|
|
|
|
|
|
|
| |
* arith.c, cadr.c, debug.c, eval.c, filter.c, gencadr.txr, glob.c,
hash.c, linenoise/linenoise.c, lisplib.c, match.c, parser.c, rand.c,
regex.c, signal.c, stream.c, struct.c, sysif.c, syslog.c, txr.c,
unwind.c, utf8.c: Remove unncessary header files.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c: include <assert.h> that was previously coming
via "mpi.h".
* mpi/mpi.c: Includes of <stdio.h>, <ctype.h> and <assert.h>
moved here.
* mpi/mpi.h: Remove include of <stdio.h>, <ctype.h> and
<assert.h>. Keeping <limits.h> for now; needed for CHAR_BIT.
* mpi/mplogic.c: Needs <assert.h>
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* filter.c (tobase64_k, frombase64_k): New keyword symbol variables.
(col_check, get_base64_char, b64_code): New static functions.
(base64_decode, base64_encode): New functions.
(filter_init): Initialize new keyword symbol variables, and register
base64-encode and base64-decode intrinsic functions.
* filter.h (base64_encode, base64_decode): Declared.
* txr.1: Documented base64-encode, base64-decode,
as well as :tobase64 and :frombase64.
|