mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
maxseg / TCP_MAXSEG support added
This commit is contained in:
1 parent
d67a052aa8
commit
2cd0a34fd5
2 files changed
+18
-3
No files matched your search
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user