diff options
-rw-r--r-- | docs/tcp.html | 4 | ||||
-rw-r--r-- | src/options.c | 16 | ||||
-rw-r--r-- | src/options.h | 7 | ||||
-rw-r--r-- | src/tcp.c | 6 |
4 files changed, 33 insertions, 0 deletions
diff --git a/docs/tcp.html b/docs/tcp.html index 9cc173e..f15196c 100644 --- a/docs/tcp.html +++ b/docs/tcp.html | |||
@@ -485,6 +485,10 @@ disables the Nagle's algorithm for the connection;</li> | |||
485 | 485 | ||
486 | <li> '<tt>tcp-keepintvl</tt>': value for <tt>TCP_KEEPINTVL</tt> Linux only!!</li> | 486 | <li> '<tt>tcp-keepintvl</tt>': value for <tt>TCP_KEEPINTVL</tt> Linux only!!</li> |
487 | 487 | ||
488 | <li> '<tt>tcp-fastopen</tt>': value for <tt>TCP_FASTOPEN</tt> Linux only!!</li> | ||
489 | |||
490 | <li> '<tt>tcp-fastopen-connect</tt>': value for <tt>TCP_FASTOPEN_CONNECT</tt> Linux only!!</li> | ||
491 | |||
488 | <li> '<tt>ipv6-v6only</tt>': | 492 | <li> '<tt>ipv6-v6only</tt>': |
489 | Setting this option to <tt>true</tt> restricts an <tt>inet6</tt> socket to | 493 | Setting this option to <tt>true</tt> restricts an <tt>inet6</tt> socket to |
490 | sending and receiving only IPv6 packets.</li> | 494 | sending and receiving only IPv6 packets.</li> |
diff --git a/src/options.c b/src/options.c index 2b53c67..51ea351 100644 --- a/src/options.c +++ b/src/options.c | |||
@@ -190,6 +190,22 @@ int opt_set_send_buf_size(lua_State *L, p_socket ps) | |||
190 | return opt_setint(L, ps, SOL_SOCKET, SO_SNDBUF); | 190 | return opt_setint(L, ps, SOL_SOCKET, SO_SNDBUF); |
191 | } | 191 | } |
192 | 192 | ||
193 | // /*------------------------------------------------------*/ | ||
194 | |||
195 | #ifdef TCP_FASTOPEN | ||
196 | int opt_set_tcp_fastopen(lua_State *L, p_socket ps) | ||
197 | { | ||
198 | return opt_setint(L, ps, IPPROTO_TCP, TCP_FASTOPEN); | ||
199 | } | ||
200 | #endif | ||
201 | |||
202 | #ifdef TCP_FASTOPEN_CONNECT | ||
203 | int opt_set_tcp_fastopen_connect(lua_State *L, p_socket ps) | ||
204 | { | ||
205 | return opt_setint(L, ps, IPPROTO_TCP, TCP_FASTOPEN_CONNECT); | ||
206 | } | ||
207 | #endif | ||
208 | |||
193 | /*------------------------------------------------------*/ | 209 | /*------------------------------------------------------*/ |
194 | int opt_set_ip6_unicast_hops(lua_State *L, p_socket ps) | 210 | int opt_set_ip6_unicast_hops(lua_State *L, p_socket ps) |
195 | { | 211 | { |
diff --git a/src/options.h b/src/options.h index 41f7337..a4d5d75 100644 --- a/src/options.h +++ b/src/options.h | |||
@@ -64,6 +64,13 @@ int opt_get_recv_buf_size(lua_State *L, p_socket ps); | |||
64 | int opt_set_send_buf_size(lua_State *L, p_socket ps); | 64 | int opt_set_send_buf_size(lua_State *L, p_socket ps); |
65 | int opt_get_send_buf_size(lua_State *L, p_socket ps); | 65 | int opt_get_send_buf_size(lua_State *L, p_socket ps); |
66 | 66 | ||
67 | #ifdef TCP_FASTOPEN | ||
68 | int opt_set_tcp_fastopen(lua_State *L, p_socket ps); | ||
69 | #endif | ||
70 | #ifdef TCP_FASTOPEN_CONNECT | ||
71 | int opt_set_tcp_fastopen_connect(lua_State *L, p_socket ps); | ||
72 | #endif | ||
73 | |||
67 | int opt_set_ip6_unicast_hops(lua_State *L, p_socket ps); | 74 | int opt_set_ip6_unicast_hops(lua_State *L, p_socket ps); |
68 | int opt_get_ip6_unicast_hops(lua_State *L, p_socket ps); | 75 | int opt_get_ip6_unicast_hops(lua_State *L, p_socket ps); |
69 | 76 | ||
@@ -109,6 +109,12 @@ static t_opt optset[] = { | |||
109 | {"linger", opt_set_linger}, | 109 | {"linger", opt_set_linger}, |
110 | {"recv-buffer-size", opt_set_recv_buf_size}, | 110 | {"recv-buffer-size", opt_set_recv_buf_size}, |
111 | {"send-buffer-size", opt_set_send_buf_size}, | 111 | {"send-buffer-size", opt_set_send_buf_size}, |
112 | #ifdef TCP_FASTOPEN | ||
113 | {"tcp-fastopen", opt_set_tcp_fastopen}, | ||
114 | #endif | ||
115 | #ifdef TCP_FASTOPEN_CONNECT | ||
116 | {"tcp-fastopen-connect", opt_set_tcp_fastopen_connect}, | ||
117 | #endif | ||
112 | {NULL, NULL} | 118 | {NULL, NULL} |
113 | }; | 119 | }; |
114 | 120 | ||