summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-03-19 06:54:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-03-19 06:54:14 -0700
commitea9ba58da58fc03e4b1ae1d6e277dad8189fa920 (patch)
treedca22ce43dcfaf3489ddf33513b94ab41b786655 /stream.c
parent5e3c8d5663f7c7f001669bb9d91485244f8ce799 (diff)
downloadtxr-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.c')
-rw-r--r--stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index ad83fc99..9029ddc1 100644
--- a/stream.c
+++ b/stream.c
@@ -1148,7 +1148,7 @@ static struct strm_ops pipe_ops =
stdio_clear_error,
stdio_get_fd);
-static struct stdio_mode parse_mode(val mode_str)
+struct stdio_mode parse_mode(val mode_str)
{
struct stdio_mode m = stdio_mode_init_trivial(0);
const wchar_t *ms = c_str(mode_str);