From fe53378596df213f4e1be079c59b4d23be24ee62 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Sat, 29 Nov 2025 15:05:29 +0300 Subject: [PATCH] maxseg / TCP_MAXSEG support added --- src/conf.c | 12 +++++++++--- src/proxymain.c | 9 +++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/conf.c b/src/conf.c index 39219ac..bac80fd 100644 --- a/src/conf.c +++ b/src/conf.c @@ -466,6 +466,11 @@ static int h_rotate(int argc, unsigned char **argv){ return 0; } +static int h_maxseg(int argc, unsigned char **argv){ + conf.maxseg = atoi((char *)argv[1]); + return 0; +} + static int h_logformat(int argc, unsigned char **argv){ unsigned char * old = conf.logformat; conf.logformat = (unsigned char *)mystrdup((char *)argv[1]); @@ -1645,11 +1650,12 @@ struct commands commandhandlers[]={ {commandhandlers+61, "force", h_force, 1, 1}, {commandhandlers+62, "noforce", h_noforce, 1, 1}, {commandhandlers+63, "parentretries", h_parentretries, 2, 2}, - {commandhandlers+64, "auto", h_proxy, 1, 0}, + {commandhandlers+64, "auto", h_proxy, 1, 0}, {commandhandlers+65, "backlog", h_backlog, 2, 2}, - {commandhandlers+66, "tlspr", h_proxy, 1, 0}, + {commandhandlers+66, "tlspr", h_proxy, 1, 0}, + {commandhandlers+67, "maxseg", h_maxseg, 2, 2}, #ifndef NORADIUS - {commandhandlers+67, "radius", h_radius, 3, 0}, + {commandhandlers+68, "radius", h_radius, 3, 0}, #endif {specificcommands, "", h_noop, 1, 0} }; diff --git a/src/proxymain.c b/src/proxymain.c index 2e11e97..43810eb 100644 --- a/src/proxymain.c +++ b/src/proxymain.c @@ -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<