summaryrefslogtreecommitdiff
path: root/module/system/repl
AgeCommit message (Collapse)AuthorFilesLines
2024-10-25Better REPL behavior on syntax errors in meta commands.Taylan Kammer3-9/+12
Fixes <https://bugs.gnu.org/30600>. * module/system/repl/command.scm (define-meta-command): Flush all remaining input after handling a read error. * module/system/repl/common.scm (flush-all-input): New public procedure. * module/system/repl/repl.scm: Remove local flush-all-input definition.
2024-10-12Create procedure to enable silencing the Guile welcome message. * ↵Matthew Wette1-2/+8
module/system/repl/repl.scm: add parameter `%inhibit-welcome-message' * module/system/repl/repl.scm(run-repl*): add condition for calling procedure repl-welcome: if (%inhibit-welcome-message) is `#t', don't
2024-07-12define-meta-command: mention effects of a missing categoryRob Browning1-0/+2
module/system/repl/command.scm: add comment.
2024-05-06Fix error messages containing format stringsMichael Käppler2-3/+8
The builtin primitive procedure `error` takes an optional message and a list of arguments to include into the error message. These args are formatted with `~S` and appended to the error message, so that an example call of `(error "Wrong argument: " 42)` results in the output "Wrong argument: 42" If format strings occur in the message itself, however, they are escaped. Thus a call like `(error "Wrong argument: ~a" 42)` is rendered as "Wrong argument: ~a 42" Some callers did not take this behavior into account, leading to confusing error messages. Changing the behavior of `error` to be both backwards-compatible and accept also format strings inside messages is not straightforward, because it would have to handle escaped `~` characters as well. Therefore, fix `error` call sites using format strings to use `format` before calling out to `error`. The following files are affected: * module/ice-9/format.scm (format) * module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface) * module/oop/goops.scm (make) * module/srfi/srfi-37.scm (Comment at the beginning of file) * module/system/base/compile.scm (call-once) * module/system/repl/command.scm (break, tracepoint) * module/system/repl/common.scm (repl-default-options) * module/system/vm/traps.scm (arg-check, trap-at-source-location) There are a couple of further call sites that were left unchanged, either because they are using their own `error` procedure: * module/ice-9/read.scm * module/ice-9/command-line.scm or are not referenced from other modules: * module/system/base/lalr.upstream.scm: * module/sxml/upstream/assert.scm: * module/sxml/sxml-match.ss: Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-01-29default-frame-width is a parameterAndy Wingo1-3/+6
* module/system/repl/debug.scm (default-frame-width): A parameter instead of a fluid. (print-frames): Adapt use.
2024-01-24Bump user-visible copyright years to 2024.Ludovic Courtès1-2/+2
* module/ice-9/command-line.scm (version-etc): * module/scripts/compile.scm (show-version): * module/system/repl/common.scm (*version*): Bump to 2024.
2023-12-28debug: Print wider stack frames when not writing to a tty.Ludovic Courtès1-2/+12
This satisfies a longstanding complaint that Guile backtraces were being truncated too much by default (72 columns), often hindering debugging. * module/system/repl/debug.scm (default-frame-width): New variable. (print-frames): Change default #:width value depending on whether PORT is a tty.
2023-07-16Fix typos throughout codebase.Morgan Smith1-1/+1
* NEWS: * README: * doc/r5rs/r5rs.texi: * doc/ref/api-data.texi: * doc/ref/api-debug.texi: * doc/ref/api-evaluation.texi: * doc/ref/api-io.texi: * doc/ref/api-macros.texi: * doc/ref/api-procedures.texi: * doc/ref/api-scheduling.texi: * doc/ref/api-undocumented.texi: * doc/ref/libguile-concepts.texi: * doc/ref/posix.texi: * doc/ref/srfi-modules.texi: * doc/ref/vm.texi: * doc/ref/web.texi: * examples/box-dynamic-module/box.c: * examples/box-dynamic/box.c: * examples/box-module/box.c: * examples/box/box.c: * examples/safe/safe: * examples/scripts/README: * examples/scripts/hello: * gc-benchmarks/larceny/twobit-input-long.sch: * gc-benchmarks/larceny/twobit-smaller.sch: * gc-benchmarks/larceny/twobit.sch: * libguile/expand.c: * libguile/load.c: * libguile/net_db.c: * libguile/scmsigs.c: * libguile/srfi-14.c: * libguile/threads.c: * meta/guile.m4: * module/ice-9/match.upstream.scm: * module/ice-9/ports.scm: * module/language/cps/graphs.scm: * module/scripts/doc-snarf.scm: * module/srfi/srfi-19.scm: * module/system/repl/command.scm: * test-suite/tests/srfi-18.test: Fix typos. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-02-24Remove unnecessary module imports.Ludovic Courtès7-18/+0
These were found with: make GUILE_WARNINGS='-W1 -Wunused-module' * module/ice-9/copy-tree.scm: * module/ice-9/eval-string.scm: * module/ice-9/getopt-long.scm: * module/ice-9/poll.scm: * module/ice-9/popen.scm: * module/ice-9/sandbox.scm: * module/ice-9/threads.scm: * module/sxml/apply-templates.scm: * module/sxml/simple.scm: * module/system/base/types.scm: * module/system/repl/command.scm: * module/system/repl/common.scm: * module/system/repl/coop-server.scm: * module/system/repl/debug.scm: * module/system/repl/error-handling.scm: * module/system/repl/repl.scm: * module/system/repl/server.scm: * module/system/vm/assembler.scm: * module/system/vm/disassembler.scm: * module/system/vm/dwarf.scm: * module/system/vm/elf.scm: * module/system/vm/frame.scm: * module/system/vm/inspect.scm: * module/system/vm/linker.scm: * module/system/vm/program.scm: * module/system/vm/trace.scm: * module/system/vm/trap-state.scm: * module/system/vm/traps.scm: * module/system/xref.scm: * module/texinfo/indexing.scm: * module/texinfo/plain-text.scm: * module/texinfo/reflection.scm: * module/texinfo/string-utils.scm: * module/web/client.scm: * module/web/http.scm: * module/web/request.scm: * module/web/response.scm: Remove imports of unused modules.
2023-01-13Bump user-visible copyright years to 2023.Ludovic Courtès1-1/+1
* module/ice-9/command-line.scm (version-etc): * module/scripts/compile.scm (show-version): * module/system/repl/common.scm (*version*): Bump to 2023.
2022-02-11Bump user-visible copyright years to 2022Andy Wingo1-2/+2
* module/ice-9/command-line.scm (version-etc): * module/system/repl/common.scm (*version*): Bump to 2022.
2021-10-01Add ,optimize-cps REPL meta-commandAndy Wingo2-10/+23
* module/system/repl/command.scm (*command-table*): Add optimize-cps / optx. (optimize-cps): Define meta-command. * module/system/repl/common.scm (optimize*): New helper. (repl-optimize): Use helper. (repl-optimize-cps): New public function.
2021-09-20(system repl command) autoloads the compiler, disassembler, and profiler.Ludovic Courtès1-4/+6
* module/system/repl/command.scm: Autoload (system base compile), (system vm disassembler), and (statprof).
2021-01-12Finish call-with-port cleanupAndy Wingo1-2/+1
* module/rnrs/io/ports.scm (call-with-port): Remove local definition. * module/system/repl/server.scm (system): Call-with-port is imported via (ice-9 ports).
2021-01-07Bump copyright years for user-visible copyright messagesv3.0.5Andy Wingo1-2/+2
* module/ice-9/command-line.scm (version-etc): * module/scripts/compile.scm (show-version): * module/system/repl/common.scm (*version*): Bump to 2021.
2020-09-10Move copy-tree to (ice-9 copy-tree); deprecate main bindingAndy Wingo1-0/+1
* doc/ref/api-data.texi (List Constructors): * doc/ref/api-utility.texi (Copying): Update docs to mention module. * libguile.h: Remove trees.h inclusion. * libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Remove trees.c, trees.h, and related files. * libguile/init.c (scm_i_init_guile): Remove trees.h and the scm_init_trees call. * libguile/trees.c: * libguile/trees.h: Remove. * module/Makefile.am (SOURCES): Add ice-9/copy-tree.scm. * module/ice-9/copy-tree.scm: New file. * module/ice-9/deprecated.scm (copy-tree*): Export as copy-tree, proxying to (ice-9 copy-tree). * module/system/repl/common.scm: * module/web/client.scm: * test-suite/tests/elisp.test: * test-suite/tests/srfi-1.test: * module/oop/goops/save.scm: Use (ice-9 copy-tree). * test-suite/Makefile.am (SCM_TESTS): Add copy-tree.test. * test-suite/tests/copy-tree.test: New file; test pulled from eval.test. * libguile/deprecated.h: * libguile/deprecated.c (scm_copy_tree): Deprecate.
2020-05-14Fix ,optimize to be independent of tree-ilAndy Wingo1-10/+34
* module/system/repl/common.scm (repl-default-options): Add optimization-level and warning-level REPL options. (repl-optimization-level, repl-warning-level): New accessors, defaulting to the default level parameters. (repl-expand): Take target language as keyword argument rather than hard-coding tree-il. (repl-optimize): Take target language as keyword argument. Use REPL optimization and warning levels. Use generic lowering interface.
2020-01-20repl: Add missing bindings in #:autoload spec.Ludovic Courtès1-2/+3
Fixes <https://bugs.gnu.org/39196>. Reported by Matt Wette <matt.wette@gmail.com>. * module/system/repl/command.scm: Augment #:autoload set of bindings.
2020-01-14Update REPL copyright year to 2020Andy Wingo1-2/+2
* module/system/repl/common.scm (*version*): Update.
2019-06-30REPL server: Avoid deprecated '_IOFBF'.Ludovic Courtès1-1/+1
* module/system/repl/server.scm (drain-input-and-close): Use 'block instead of _IOFBF.
2019-06-24Remove references to 'inet-ntoa' and 'inet-aton'.Ludovic Courtès1-2/+4
These procedures were removed in Guile 2.2 by commit fc7bd367ab4b5027a7f80686b1e229c62e43c90b (May 2011). * libguile/socket.h (scm_inet_aton, scm_inet_ntoa): Remove. * module/system/repl/server.scm (make-tcp-server-socket): Use 'inet-pton' instead of 'inet-aton'. * doc/ref/web.texi (HTTP): Likewise in 'declare-header!' example. * doc/ref/posix.texi (Network Address Conversion): Remove documentation of 'inet-ntoa' and 'inet-aton'.
2019-06-18Avoid regexp ranges in HTTP inter-protocol exploitation check.Mark H Weaver1-1/+1
* module/system/repl/server.scm (permissive-http-request-line?): Avoid character ranges in regexp.
2019-04-16Update user-visible copyright years.Mark H Weaver1-2/+2
* doc/ref/guile.texi: Update years in copyright notice. * module/ice-9/command-line.scm (version-etc): Update 'copyright-year'. * module/system/repl/common.scm (*version*): Update copyright years.
2017-03-15Update --version and REPL copyright yearsAndy Wingo1-1/+1
* module/ice-9/command-line.scm (version-etc): * module/system/repl/common.scm (*version*): Update release year.
2017-03-01REPL Server: Guard against HTTP inter-protocol exploitation attacks.Mark H Weaver2-4/+188
Reported by Christopher Allan Webber <cwebber@dustycloud.org> Co-authored-by: Ludovic Courtès <ludo@gnu.org> This commit adds protection to Guile's REPL servers against HTTP inter-protocol exploitation attacks, a scenario whereby an attacker can, via an HTML page, cause a web browser to send data to TCP servers listening on a loopback interface or private network. See <https://en.wikipedia.org/wiki/Inter-protocol_exploitation> and <https://www.jochentopf.com/hfpa/hfpa.pdf>, The HTML Form Protocol Attack (2001) by Tochen Topf <jochen@remote.org>. Here we add a procedure to 'before-read-hook' that looks for a possible HTTP request-line in the first line of input from the client socket. If present, the socket is drained and closed, and a loud warning is written to stderr (POSIX file descriptor 2). * module/system/repl/server.scm: Add 'maybe-check-for-http-request' to 'before-read-hook' when this module is loaded. (with-temporary-port-encoding, with-saved-port-line+column) (drain-input-and-close, permissive-http-request-line?) (check-for-http-request, guard-against-http-request) (maybe-check-for-http-request): New procedures. (serve-client): Use 'guard-against-http-request'. * module/system/repl/coop-server.scm (start-repl-client): Use 'guard-against-http-request'. * doc/ref/guile-invoke.texi (Command-line Options): In the description of the --listen option, make the security warning more prominent. Mention the new protection added here. Recommend using UNIX domain sockets for REPL servers. "a path to" => "the file name of".
2017-03-01Cosmetic REPL server improvementsAndy Wingo1-10/+10
* module/system/repl/server.scm (run-server*): Cosmetic improvements.
2017-02-07Avoid stacks in dynamically-bound valuesAndy Wingo2-5/+5
* libguile/dynstack.h: * libguile/dynstack.c (scm_dynstack_find_old_fluid_value): New function. * libguile/fluids.c (saved_dynamic_state_ref): New helper. (scm_fluid_ref): Fix docstring. (scm_fluid_ref_star): New function allowing access to previous values for a fluid. (scm_dynamic_state_ref): New internal function. * libguile/fluids.h: Add scm_fluid_ref_star and scm_dynamic_state_ref. * libguile/stacks.c (scm_stack_id): Adapt to %stacks not being a chain. * libguile/throw.c (catch, throw_without_pre_unwind): Adapt to %exception-handlers not being a chain. * module/ice-9/boot-9.scm (catch, dispatch-exception): Instead of having %exception-handlers be a chain, use fluid-ref* to access the chain that is in place at the time the exception is thrown. Prevents unintended undelimited capture of the current exception handler stack by a delimited "catch". (%start-stack): Similarly, don't be a chain. * module/system/repl/debug.scm (frame->stack-vector): * module/system/repl/error-handling.scm (call-with-error-handling): * module/ice-9/save-stack.scm (save-stack): Adapt to %stacks not being a chain. * test-suite/tests/exceptions.test ("delimited exception handlers"): Add tests. * doc/ref/api-control.texi (Fluids and Dynamic States): Add docs.
2016-10-31REPL server avoids thread cleanup handlersAndy Wingo1-11/+12
* module/system/repl/server.scm (serve-client): Avoid thread cleanup handlers.
2016-10-19Adapt run-server* to change to `accept'.Andy Wingo1-25/+9
* module/system/repl/server.scm (run-server*): Adapt to new #f return value of accept on non-blocking ports. (errs-to-retry): Remove variable.
2016-08-25Fix exception when running ",help debug"Andy Wingo1-1/+1
* module/system/repl/command.scm (*command-table*): Remove entry for ",procedure", a command removed a few months ago.
2016-06-21Importing modules with #:select no longer grovels private bindingsAndy Wingo1-5/+9
* module/ice-9/boot-9.scm (resolve-interface): Don't look in private interface for #:select bindings. Fixes #17418. * module/system/repl/coop-server.scm: Don't rely on bad #:select behavior. * NEWS: Add entry.
2016-05-22Bump user-visible copyright years to 2016.Mark H Weaver1-3/+2
* doc/ref/guile.texi: Add 2016 to user-visible copyright notice. * module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to 2016. * module/system/repl/common.scm (*version*): Add 2016 to the range of copyright years.
2016-05-22Bump user-visible copyright years to 2015.Mark H Weaver1-1/+1
* module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to 2015. * module/system/repl/common.scm (*version*): Add 2015 to the range of copyright years.
2016-04-04Fix frame->stack-vector when no stack is activeAndy Wingo1-15/+17
* module/system/repl/debug.scm (frame->stack-vector): Handle the case where there is no active stack.
2016-01-31Frame <binding> objects capture frame, can ref value directlyAndy Wingo1-1/+1
* module/system/repl/debug.scm (print-locals): Adapt to frame-binding-ref change. * module/system/vm/frame.scm (<binding>): Add `frame' field. (available-bindings): Capture the frame. (binding-ref, binding-set!): New functions, accessing a local variable value directly from a frame. (frame-binding-ref, frame-binding-set!): Remove. As these are very low-level debugging interfaces introduced in 2.0, never documented, and quite tied to the VM, we feel comfortable making this change. (frame-call-representation): Adapt to available-bindings change. (frame-environment, frame-object-binding): Adapt to binding-ref interface change. * doc/ref/vm.texi (Stack Layout): Mention that slots can be re-used. Update disassembly in example. * doc/ref/api-debug.texi (Frames): Remove documentation for frame-local-ref, frame-local-set!, and frame-num-locals. Replace with documentation for frame-bindings, binding accessors, and binding-ref / binding-set!.
2016-01-31Remove frame-local-ref, frame-local-set!Andy Wingo1-2/+1
* libguile/frames.h (scm_frame_num_locals, scm_frame_local_ref) (scm_frame_local_set_x): Remove. As long as we are changing the interface in a backward-incompatible way, we might as well remove these. * libguile/frames.c (scm_frame_num_locals, scm_frame_local_ref) (scm_frame_local_set_x, scm_init_frames_builtins, scm_init_frames): Arrange to make frame-local-ref et al private to frames.scm. * module/system/vm/frame.scm: Load scm_init_frames_builtins extensions. (frame-instruction-pointer-or-primitive-procedure-name): New public function. (frame-binding-ref, frame-binding-set!): Allow binding objects as vars. * module/system/repl/debug.scm (print-locals): Pass binding directly to frame-binding-ref. * module/statprof.scm (sample-stack-procs, count-call): Use new frame-instruction-pointer-or-primitive-procedure-name function.
2015-12-01Remove frame->moduleAndy Wingo1-28/+1
* module/system/repl/debug.scm (frame->module): Remove. Has been broken for a while, had no callers, and was calling frame-procedure. We can revive again in a better way, like ice-9 local-eval.
2015-12-01Remove `procedure' repl commandAndy Wingo1-5/+0
* doc/ref/scheme-using.texi (Debug Commands): * module/system/repl/command.scm (procedure): Remove REPL command. Since there is a closure binding and we have improved the ,registers output, this is no longer necessary and by removing it we remove another bogus use of frame-procedure.
2015-12-01,registers doesn't use frame-procedureAndy Wingo1-6/+8
* module/system/repl/debug.scm (print-registers): Avoid frame-procedure, and be more useful and print an offset in units of 4 bytes.
2015-10-28Reflection support for unboxed f64 slotsAndy Wingo1-2/+4
* module/system/vm/assembler.scm (emit-definition): Add representation field. (write-arities): Emit representations into the arities section. * module/system/vm/debug.scm (arity-definitions): Read representations. * module/system/vm/frame.scm (<binding>): Add representation field and binding-representation getter. (available-bindings): Pass representation to make-binding. (frame-binding-set!, frame-binding-ref, frame-call-representation): Pass representation to frame-local-ref / frame-local-set!. * test-suite/tests/rtl.test: Update definition instructions. * module/language/cps/slot-allocation.scm ($allocation): Add representations field. (lookup-representation): New public function. (allocate-slots): Pass representations to make-$allocation. * module/language/cps/compile-bytecode.scm (compile-function): Adapt to emit-definition change. * libguile/frames.h: * libguile/frames.c (scm_frame_local_ref, scm_frame_local_set_x): Take representation argument. (scm_to_stack_item_representation): New internal helper.
2015-07-20Fix error printing some wrong-num-args backtracesAndy Wingo1-2/+3
* module/system/repl/debug.scm (print-frame): Pass #:top-frame? #t for the top frame. * module/system/vm/frame.scm (available-bindings): Be permissive and allow #:top-frame? #f even when the IP is at the start of the function.
2014-05-04frame-address, frame-stack-pointer return offsetsAndy Wingo1-2/+2
* libguile/frames.c (scm_frame_address, scm_frame_stack_pointer): Return offsets instead of absolute pointers. This is robust in the presence of stack relocation. * module/system/repl/debug.scm (print-registers): Adapt to print sp and fp as integers.
2014-04-25Merge branch 'stable-2.0'v2.1.0Mark H Weaver3-26/+284
Conflicts: GUILE-VERSION NEWS guile-readline/ice-9/readline.scm libguile/async.c libguile/backtrace.c libguile/deprecated.h libguile/gc-malloc.c libguile/gdbint.c libguile/init.c libguile/ioext.c libguile/mallocs.c libguile/print.c libguile/rw.c libguile/scmsigs.c libguile/script.c libguile/simpos.c libguile/snarf.h libguile/strports.c libguile/threads.c libguile/vm-i-scheme.c libguile/vm-i-system.c module/srfi/srfi-18.scm test-suite/Makefile.am test-suite/standalone/test-num2integral.c
2014-04-16Update frame-bindings interfaceAndy Wingo1-13/+9
* module/system/repl/debug.scm (print-locals): Update to work with new interface. (frame->module): Update. Still doesn't work due to lack of `program-module', though. * module/system/vm/program.scm (make-binding, binding:name) (binding:definition-offset, program-arity-bindings-for-ip): Remove these. * module/system/vm/frame.scm (<binding>): New type. (available-bindings): Return a list of <binding> instances. (frame-lookup-binding, frame-binding-set!, frame-binding-ref): (frame-environment, frame-object-name): Adapt.
2014-03-22Out-of-memory situations raise exceptions instead of abortingAndy Wingo1-1/+1
* libguile/gc.c (scm_oom_fn, scm_init_gc): Install an out-of-memory handler that raises an unwind-only out-of-memory exception. (scm_gc_warn_proc, scm_init_gc): Install a warning proc that tries to print to the current warning port, if the current warning port is a file port. (scm_gc_after_nonlocal_exit): New interface. Should be called after a nonlocal return to potentially collect memory; otherwise allocations could try to expand again when they should collect. * libguile/continuations.c (scm_i_make_continuation): * libguile/eval.c (eval): * libguile/throw.c (catch): * libguile/vm.c (scm_call_n): Call scm_gc_after_nonlocal_exit after nonlocal returns. * libguile/throw.c (abort_to_prompt, throw_without_pre_unwind): Rework to avoid allocating memory. (scm_report_out_of_memory): New interface. (scm_init_throw): Pre-allocate the arguments for stack-overflow and out-of-memory errors. * module/ice-9/boot-9.scm: Add an out-of-memory exception printer. * module/system/repl/error-handling.scm (call-with-error-handling): Add out-of-memory to the report-keys set. * libguile/gc-malloc.c (scm_realloc): Call scm_report_out_of_memory if realloc fails. * libguile/error.h: * libguile/error.c: * libguile/deprecated.h: * libguile/deprecated.c (scm_memory_error): Deprecate. * test-suite/standalone/Makefile.am: * test-suite/standalone/test-out-of-memory: New test case.
2014-03-16Document stack-overflow handlers, limits, and unwind-only exceptionsAndy Wingo1-26/+22
* module/system/repl/error-handling.scm (call-with-error-handling): Add #:report-keys kwarg, so that unwind-only exceptions (stack-overflow in particular) get reported. * doc/ref/api-debug.texi (Pre-Unwind Debugging): Add documentation for #:report-keys kwarg of call-with-error-handling. (Stack Overflow): New subsubsection. (Debug Options): Remove discussion of stack overflow.
2014-02-12Add cooperative REPL server module.David Thompson3-2/+210
Modified-by: Mark H Weaver <mhw@netris.org> * module/system/repl/coop-server.scm: New module. * module/system/repl/repl.scm (start-repl): Extract body to start-repl*. (start-repl*): New procedure. (run-repl): Extract body to run-repl*. (run-repl*): New procedure. * module/system/repl/server.scm (run-server): Extract body to run-server*. (run-server*): New procedure. * doc/ref/api-evaluation.texi (Cooperative REPL Servers): New node. * module/Makefile.am (SYSTEM_SOURCES): Add system/repl/coop-server.scm.
2014-02-12REPL Server: Fix 'stop-server-and-clients!'.Mark H Weaver1-24/+74
* module/system/repl/server.scm: Import (ice-9 match) and (srfi srfi-1). (*open-sockets*): Add comment. This is now a list of pairs with a 'force-close' procedure in the cdr. (close-socket!): Add comment noting that it is unsafe to call this from another thread. (add-open-socket!): Add 'force-close' argument, and put it in the cdr of the '*open-sockets*' entry. (stop-server-and-clients!): Use 'match'. Remove the first element from *open-sockets* immediately. Call the 'force-close' procedure instead of 'close-socket!'. (errs-to-retry): New variable. (run-server): Add a pipe, used in the 'force-close' procedure to cleanly shut down the server. Put the server socket into non-blocking mode. Use 'select' to monitor both the server socket and the pipe. Don't call 'add-open-socket!' on the client-socket. Close the pipe and the server socket cleanly when we're asked to shut down. (serve-client): Call 'add-open-socket!' with a 'force-close' procedure that cancels the thread. Set the thread cleanup handler to call 'close-socket!', instead of calling it in the main body. * doc/ref/api-evaluation.texi (REPL Servers): Add a caveat to the manual entry for 'stop-servers-and-clients!'.
2014-02-07Merge commit '40a723a92236fe4e58feb89057b4182b1fc76810'Andy Wingo1-13/+7
2014-02-07Merge commit 'a5cbbaa66a2491453db0edff9b0cb592a98f61bf'Andy Wingo1-18/+1