diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-03-19 06:54:14 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-03-19 06:54:14 -0700 |
commit | ea9ba58da58fc03e4b1ae1d6e277dad8189fa920 (patch) | |
tree | dca22ce43dcfaf3489ddf33513b94ab41b786655 /stream.h | |
parent | 5e3c8d5663f7c7f001669bb9d91485244f8ce799 (diff) | |
download | txr-ea9ba58da58fc03e4b1ae1d6e277dad8189fa920.tar.gz txr-ea9ba58da58fc03e4b1ae1d6e277dad8189fa920.tar.bz2 txr-ea9ba58da58fc03e4b1ae1d6e277dad8189fa920.zip |
Size mode meaningful in datagram sockets.
* socket.c (struct dgram_stream): new rx_max member.
(make_dgram_sock_stream): New arguments: a struct stdio_mode,
and pointer to prototype dgram socket. If a size is specified
in the mode, then use that as rx_max. Otherwise if a prototype
socket is specified, use its rx_max as the new socket's rx_max.
Otherwise default on 65536.
(dgram_get_byte_callback): Use d->rx_max as the capture size,
rather than a hard-coded 65536.
(sock_accept): Use d->rx_max as capture size for datagram.
Parse the mode. Pass the parsed mode to make_dgram_sock_stream,
as well as the accepting socket, so it can set up the rx_max
for the new socket.
(open_sockfd): Parse the mode and pass to make_dgram_sock_stream.
* stream.c (parse_mode): Static function becomes extern.
* stream.h (parse_mode): Declared.
* txr.1: Documented.
Diffstat (limited to 'stream.h')
-rw-r--r-- | stream.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -126,6 +126,7 @@ void fill_stream_ops(struct strm_ops *ops); void stream_print_op(val stream, val out, val pretty); void stream_mark_op(val stream); void stream_destroy_op(val stream); +struct stdio_mode parse_mode(val mode_str); val normalize_mode(struct stdio_mode *m, val mode_str); val set_mode_props(const struct stdio_mode m, val stream); val generic_get_line(val stream); |