Age | Commit message (Collapse) | Author | Files | Lines |
|
* module/web/server/ethreads.scm: New file, an ethreads-based HTTP
server.
* module/Makefile.am: Add to build.
|
|
* examples/ethreads/memcached-client.scm:
* examples/ethreads/memcached-server.scm: Two new ethreads examples.
Not really optimized, no consideration for memory use, but perhaps
instructive.
|
|
* module/ice-9/ethreads.scm: New module, providing cooperative
lightweight threads that yield when they would otherwise sleep or wait
for I/O.
* module/Makefile.am: Add to build.
|
|
* configure.ac: Add checks for sys/epoll.h, epoll_create, and
epoll_create1.
* libguile/poll.c (scm_primitive_epoll_create, scm_primitive_epoll_ctl)
(scm_primitive_epoll_wait): New primitives for (ice-9 epoll).
Registered via a scm_init_epoll extension.
* module/Makefile.am: Add ice-9/epoll.scm.
* module/ice-9/epoll.scm: New file.
|
|
* module/ice-9/sports.scm (accept, connect): New Scheme functions.
|
|
* libguile/socket.c (scm_connect):
* doc/ref/posix.texi (Network Sockets and Communication): Support
connect on nonblocking ports.
|
|
* doc/ref/posix.texi (Network Sockets and Communication):
* libguile/socket.c (scm_accept): Return #f if the socket is nonblocking
and no connection is ready.
|
|
* libguile/ports.c (scm_port_encode_char): New function.
* module/ice-9/ports.scm (port-encode-char): Export port-encode-char to
the internals module.
* module/ice-9/sports.scm (put-char): New function.
(port-bindings): Add put-char and put-string.
|
|
* module/ice-9/suspendable-ports.scm: Rename from ice-9/sports.scm, and
adapt module names. Remove exports that are not related to the
suspendable ports facility; we want people to continue using the port
operations from their original locations. Add put-string to the
replacement list.
* module/Makefile.am: Adapt to rename.
* test-suite/tests/suspendable-ports.test: Rename from sports.test.
* test-suite/Makefile.am: Adapt to rename.
* module/ice-9/textual-ports.scm (unget-char, unget-string): New
functions.
* doc/ref/api-io.texi (Textual I/O, Simple Output): Flesh out
documentation.
(Line/Delimited): Undocument write-line, read-string, and
read-string!. This is handled by (ice-9 textual-ports).
(Bytevector Ports): Fix duplicated section.
(String Ports): Move the note about encodings down to the end.
(Custom Ports): Add explanatory text. Remove mention of C functions;
they should use the C port interface.
(Venerable Port Interfaces): Add text, and make documentation refer to
recommended interfaces.
(Using Ports from C): Add documentation.
(Non-Blocking I/O): Document more fully and adapt to suspendable-ports
name change.
|
|
* doc/ref/api-io.texi: Update to document ports more thoroughly. Still
some work needed.
* doc/ref/r6rs.texi: Move ports documentation back to r6rs.texi, now
that Guile has a more thorough binary/textual I/O story, heavily based
on R6RS.
* doc/ref/api-control.texi:
* doc/ref/api-data.texi:
* doc/ref/api-options.texi:
* doc/ref/misc-modules.texi:
* doc/ref/posix.texi:
* doc/ref/srfi-modules.texi: Update references.
|
|
* doc/ref/api-io.texi (Block Reading and Writing): Undocument (ice-9
rw). The R6RS routines do the same job and are not so clunky.
|
|
* module/ice-9/textual-ports.scm: New module.
* module/Makefile.am: Add new module.
|
|
* libguile/ports.h (scm_put_char):
* libguile/ports.c (scm_put_char): New function.
(scm_put_string): Add docstrings, and expose to the internal ports
module.
* module/ice-9/ports.scm (put-char, put-string): Expose these bindings
only through the internals module.
|
|
* libguile/socket.c (scm_init_socket): Define TCP_NODELAY and TCP_CORK
if they are available.
* doc/ref/posix.texi (Network Sockets and Communication): Add
documentation.
* NEWS: Add entry.
|
|
* module/ice-9/ports.scm: Export port-encode-chars and
port-clear-stream-start-for-bom-write via the internals module.
* module/ice-9/sports.scm (put-string): New function.
|
|
* libguile/ports.c (scm_port_clear_stream_start_for_bom_write): Instead
of returning the BOM, take an optional buffer in which to write the
BOM. Return number of bytes written.
(port_clear_stream_start_for_bom_write): Remove.
(scm_i_write): Adapt scm_port_clear_stream_start_for_bom_write call.
(try_encode_char_to_iconv_buf, encode_latin1_chars_to_latin1_buf):
(encode_latin1_chars_to_utf8_buf, encode_latin1_chars_to_iconv_buf):
(encode_latin1_chars, encode_utf32_chars_to_latin1_buf):
(encode_utf32_chars_to_utf8_buf, encode_utf32_chars_to_iconv_buf):
(encode_utf32_chars, port_encode_chars): New helpers.
(scm_port_encode_chars): New procedure.
(scm_c_put_latin1_chars, scm_c_put_utf32_chars): Rework to use new
encoding helpers.
(scm_lfwrite): Use scm_c_put_latin1_chars.
|
|
* libguile/print.h:
* libguile/print.c: Use the new routines from ports.[ch].
|
|
* libguile/ports.h:
* libguile/ports.c (scm_c_put_escaped_char, scm_c_can_put_char): New
helpers.
|
|
* libguile/print.c (iprin1): Use scm_c_put_string for strings.
* test-suite/test-suite/lib.scm (exception:encoding-error): Add an
additional expected error string for `encoding-error'.
|
|
* libguile/print.c (print_normal_symbol): Use new port functions.
|
|
* libguile/ports.h (scm_c_put_latin1_chars, scm_c_put_utf32_chars)
(scm_c_put_char, scm_c_put_string, scm_print_string): New public
functions. The plan is to move encoding to ports.c and out of
print.c.
* libguile/ports.c (UTF8_BUFFER_SIZE, ESCAPE_BUFFER_SIZE): New internal
defines.
(update_port_position): Take a position instead of a port. Update
callers.
(utf8_to_codepoint): Allow lengths that are larger than necessary.
(port_clear_stream_start_for_bom_write): Require that io_mode be
BOM_IO_TEXT to write a BOM.
(scm_fill_input): Add a related comment about BOM handling.
(scm_i_write): use BOM_IO_TEXT, at least for now.
(encode_escape_sequence, codepoint_to_utf8, utf8_to_codepoint)
(put_utf8_chars_to_iconv_port, put_latin1_chars_to_utf8_port)
(put_latin1_chars_to_iconv_port, put_utf32_chars_to_latin1_port)
(put_utf32_chars_to_utf8_port, put_utf32_chars_to_iconv_port): New
helpers.
(scm_putc, scm_puts): Use scm_c_put_char and scm_put_latin1_chars.
|
|
* libguile/ports.c (scm_port_line_buffered_p): New function.
* module/ice-9/ports.scm: Plump port-line-buffered? and
port-auxiliary-write-buffer through to the internals module
|
|
* libguile/ports.c (port_clear_stream_start_for_bom_write): Rework to be
friendly to Scheme write implementations.
|
|
* libguile/ports-internal.h (scm_t_port): Add write_buf_aux field.
* libguile/ports.h (scm_port_auxiliary_write_buffer): New internal
decl.
* libguile/ports.c (AUXILIARY_WRITE_BUFFER_SIZE): New constant.
(initialize_port_buffers): Init aux write buf.
(scm_port_auxiliary_write_buffer): Lazily allocate an aux write
buffer.
(scm_c_write): Arrange to write through an aux buffer if the port is
unbuffered.
|
|
* module/ice-9/sports.scm (put-u8, put-bytevector): Speed hack.
|
|
* module/ice-9/sports.scm (put-u8): Add implementation.
(port-bindings): Add put-u8.
|
|
* module/ice-9/sports.scm (flush-input): New helper.
(put-bytevector): New function.
(port-bindings): Add put-bytevector.
|
|
* module/ice-9/sports.scm (write-bytes): Support non-blocking writes.
(force-output, flush-output): Rearrange placement.
|
|
* module/ice-9/sports.scm (close-port): New function.
(port-bindings): Add close-port.
|
|
* module/ice-9/sports.scm (force-output): New implementation.
(port-bindings): Add force-output.
|
|
* libguile/ports-internal.h (scm_t_port): Rework to store iconv
descriptors inline, so that the port finalizer doesn't race with the
iconv descriptor finalizer. Access is serialized through a lock.
Fixes a bug whereby if the port finalizer and the descriptor finalizer
run on different threads, the close-port run by the port finalizer
could try to free the iconv descriptors at the same time as the
descriptor finalizer.
* libguile/ports.c (iconv_lock): New static variable.
(scm_c_make_port_with_encoding): Initialize iconv-related fields.
(scm_close_port): Lock while frobbing iconv descriptors.
(prepare_iconv_descriptors): Adapt.
(scm_specialize_port_encoding_x, scm_i_set_port_encoding_x): Lock
while preparing iconv descriptors.
(scm_port_acquire_iconv_descriptors)
(scm_port_release_iconv_descriptors): New functions, which replace
scm_i_port_iconv_descriptors.
(scm_port_decode_char): Lock around iconv operations.
(port_clear_stream_start_for_bom_write): Acquire iconv descriptors
before checking precise_encoding, to make sure precise_encoding is
initialized.
* libguile/print.c (display_string_using_iconv): Adapt to use the new
interface to get iconv descriptors from a port.
|
|
* module/ice-9/sports.scm (fill-input): Add io-mode optional arg.
(get-bytevector-n): New implementation.
(port-bindings): Add get-bytevector-n.
* test-suite/tests/sports.test: Add r6rs-ports tests.
|
|
* libguile/ports.c (trampoline_to_c_read, trampoline_to_c_write): Fix
bugs checking ranges of start and count parameters.
|
|
* module/ice-9/sports.scm: Export read-line, %read-line, and
read-delimited. Add these latest three to install-sports!, and fix
install-sports! if the current module isn't (ice-9 sports).
* test-suite/tests/sports.test: Use install-sports! instead of lexical
bindings, to allow us to nicely frob bindings in rdelim. Include
rdelim tests.
|
|
This cherry-picks changes from stable-2.0, starting from
acd2c8e36a25d77e9e9c9b6782780b23a1764973 and ending in
461b62efc90135d3ca8719ba0f3b6ced4ad13754, inclusively. I did not
cherry-pick patches that were already on master and did not cherry-pick
ones that don't make sense on master (for example because of the port
re-write). I did pick all tests though.
I also did not cherry-pick the "Revert foreign objects" patch from
ff98cbb643d43c9f8c6ee0e0b4e1bad72aced62e; further discussion necessary.
|
|
* doc/ref/web.texi (Http Headers): Fixed typo.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
|
|
Fixes <http://bugs.gnu.org/23421>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.
* module/web/http.scm (parse-rfc-822-date): Add two clauses for hours
with a leading space.
* test-suite/tests/web-http.test ("general headers"): Add two tests.
|
|
* 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.
|
|
* module/srfi/srfi-19.scm (leap-second-table): Update to include the
most recent leap second.
|
|
* module/web/http.scm (read-line*): Remove.
(read-continuation-line, read-header, read-request-line): Use
'read-header-line' instead of 'read-line*'.
|
|
Fixes <http://bugs.gnu.org/22273>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.
* module/web/http.scm (read-header-line): New procedure.
(read-response-line): Use it instead of 'read-line*'.
* test-suite/tests/web-http.test ("read-response-line"): Add test.
|
|
* test-suite/tests/web-http.test ("read-response-line")["missing
CR/LF"]: New test.
|
|
* 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.
|
|
Reported by Park SungMin <byulparan_eng@icloud.com>
in <https://lists.gnu.org/archive/html/guile-user/2015-11/msg00026.html>.
* libguile/socket.c (scm_getsockopt, scm_setsockopt): Remove code that
incorrectly assumed that the argument for SO_SNDBUF and SO_RCVBUF
options was of type 'size_t'. Both the Linux and POSIX documentation
indicates that the argument is of type 'int', as is the case for most
options.
|
|
Suggested by Mike Gran <spk121@yahoo.com>.
* libguile/srfi-14.i.c: Regenerate for Unicode 8.0.0,
<ftp://unicode.org/Public/UNIDATA/UnicodeData.txt> with SHA256
38b17e1118206489a7e0ab5d29d7932212d38838df7d3ec025ecb58e8798ec20.
|
|
* libguile/gen-scmconfig.c (main): Add SCM_T_OFF_MAX and SCM_T_OFF_MIN
to the generated 'scmconfig.h' file.
|
|
Suggested by Jamil Egdemir <unclejamil@gmail.com>.
* HACKING: Mention a Flex version number.
|
|
|
|
Fixes <http://bugs.gnu.org/21425>.
Reported by Kouhei Sutou <kou@cozmixng.org>.
* configure.ac: Remove 'AC_REPLACE_FUNCS' for 'mkstemp'.
* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
Remove mkstemp.c.
* libguile/mkstemp.c: Remove.
|
|
* libguile/Makefile.am (chknew-E chknew-SIG): Anchor the end of the
signal/error name pattern to only match alphanumeric symbols.
* libguile/cpp-SIG.syms (SIGEV_MAX_SIZE, SIGEV_NONE): Remove.
(SIGEV_PAD_SIZE, SIGEV_SIGNAL, SIGEV_THREAD): Likewise.
(SIGEV_THREAD_ID): Likewise.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
|