From ea9ba58da58fc03e4b1ae1d6e277dad8189fa920 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 19 Mar 2016 06:54:14 -0700 Subject: 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. --- stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stream.c') 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); -- cgit v1.2.3