maxseg / TCP_MAXSEG support added

This commit is contained in:
Vladimir Dubrovin committed 2026-04-08 19:21:26 +03:00
1 parent d67a052aa8
commit 2cd0a34fd5
2 files changed
+18 -3

No files matched your search

+9
View File
@@ -170,6 +170,9 @@ struct socketoptions sockopts[] = {
#endif
#ifdef TCP_FASTOPEN_CONNECT
{TCP_FASTOPEN_CONNECT, "TCP_FASTOPEN_CONNECT"},
#endif
#ifdef TCP_MAXSEG
{TCP_MAXSEG, "TCP_MAXSEG"},
#endif
{0, NULL}
};
@@ -193,6 +196,12 @@ void setopts(SOCKET s, int opts){
int i, opt, set;
for(i = 0; opts >= (opt = (1<<i)); i++){
set = 1;
#ifdef TCP_MAXSEG
if(sockopts[i].opt == TCP_MAXSEG){
if(!conf.maxseg) continue;
set = conf.maxseg;
}
#endif
if(opts & opt) setsockopt(s, *sockopts[i].optname == 'T'? IPPROTO_TCP:
#ifdef SOL_IP
*sockopts[i].optname == 'I'? SOL_IP: