Merge remote-tracking branch 'upstream/master' into tcp-defer-accept
This commit is contained in:
commit
6c0c6b8a13
5 changed files with 35 additions and 1 deletions
|
@ -487,6 +487,10 @@ disables the Nagle's algorithm for the connection;</li>
|
|||
|
||||
<li> '<tt>tcp-defer-accept</tt>': value for <tt>TCP_DEFER_ACCEPT</tt> Linux only!!</li>
|
||||
|
||||
<li> '<tt>tcp-fastopen</tt>': value for <tt>TCP_FASTOPEN</tt> Linux only!!</li>
|
||||
|
||||
<li> '<tt>tcp-fastopen-connect</tt>': value for <tt>TCP_FASTOPEN_CONNECT</tt> Linux only!!</li>
|
||||
|
||||
<li> '<tt>ipv6-v6only</tt>':
|
||||
Setting this option to <tt>true</tt> restricts an <tt>inet6</tt> socket to
|
||||
sending and receiving only IPv6 packets.</li>
|
||||
|
|
|
@ -34,7 +34,7 @@ local function make_plat(plat)
|
|||
},
|
||||
mingw32 = {
|
||||
"LUASOCKET_DEBUG",
|
||||
"LUASOCKET_INET_PTON",
|
||||
-- "LUASOCKET_INET_PTON",
|
||||
"WINVER=0x0501"
|
||||
}
|
||||
}
|
||||
|
@ -113,6 +113,7 @@ local function make_plat(plat)
|
|||
then
|
||||
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/wsocket.c"
|
||||
modules["socket.core"].libraries = { "ws2_32" }
|
||||
modules["socket.core"].libdirs = {}
|
||||
end
|
||||
return { modules = modules }
|
||||
end
|
||||
|
|
|
@ -190,6 +190,22 @@ int opt_set_send_buf_size(lua_State *L, p_socket ps)
|
|||
return opt_setint(L, ps, SOL_SOCKET, SO_SNDBUF);
|
||||
}
|
||||
|
||||
// /*------------------------------------------------------*/
|
||||
|
||||
#ifdef TCP_FASTOPEN
|
||||
int opt_set_tcp_fastopen(lua_State *L, p_socket ps)
|
||||
{
|
||||
return opt_setint(L, ps, IPPROTO_TCP, TCP_FASTOPEN);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TCP_FASTOPEN_CONNECT
|
||||
int opt_set_tcp_fastopen_connect(lua_State *L, p_socket ps)
|
||||
{
|
||||
return opt_setint(L, ps, IPPROTO_TCP, TCP_FASTOPEN_CONNECT);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------*/
|
||||
|
||||
#ifdef TCP_DEFER_ACCEPT
|
||||
|
|
|
@ -68,6 +68,13 @@ int opt_get_recv_buf_size(lua_State *L, p_socket ps);
|
|||
int opt_set_send_buf_size(lua_State *L, p_socket ps);
|
||||
int opt_get_send_buf_size(lua_State *L, p_socket ps);
|
||||
|
||||
#ifdef TCP_FASTOPEN
|
||||
int opt_set_tcp_fastopen(lua_State *L, p_socket ps);
|
||||
#endif
|
||||
#ifdef TCP_FASTOPEN_CONNECT
|
||||
int opt_set_tcp_fastopen_connect(lua_State *L, p_socket ps);
|
||||
#endif
|
||||
|
||||
int opt_set_ip6_unicast_hops(lua_State *L, p_socket ps);
|
||||
int opt_get_ip6_unicast_hops(lua_State *L, p_socket ps);
|
||||
|
||||
|
|
|
@ -111,6 +111,12 @@ static t_opt optset[] = {
|
|||
{"send-buffer-size", opt_set_send_buf_size},
|
||||
#ifdef TCP_DEFER_ACCEPT
|
||||
{"tcp-defer-accept", opt_set_tcp_defer_accept},
|
||||
#endif
|
||||
#ifdef TCP_FASTOPEN
|
||||
{"tcp-fastopen", opt_set_tcp_fastopen},
|
||||
#endif
|
||||
#ifdef TCP_FASTOPEN_CONNECT
|
||||
{"tcp-fastopen-connect", opt_set_tcp_fastopen_connect},
|
||||
#endif
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue