remove --mss

This commit is contained in:
ruti 2024-04-01 07:28:46 +03:00
parent 6f8176a053
commit 6f82bb1eff
3 changed files with 4 additions and 29 deletions

15
main.c
View File

@ -95,9 +95,6 @@ const char help_text[] = {
" -e, --oob-data <f|:str> Set custom OOB data, filename or :string\n"
" -M, --mod-http <h,d,r> Modify HTTP: hcsmix,dcsmix,rmspace\n"
" -r, --tlsrec <n[+s]> Make TLS record at position\n"
#ifdef __linux__
" -m, --mss <size> Set MSS for outgoing connections\n"
#endif
};
@ -141,9 +138,6 @@ const struct option options[] = {
{"mod-http", 1, 0, 'M'},
{"tlsrec", 1, 0, 'r'},
{"def-ttl", 1, 0, 'g'},
#ifdef __linux__
{"mss", 1, 0, 'm'},
#endif
{"delay", 1, 0, 'w'}, //
{"not-wait-send", 0, 0, 'W'}, //
{0}
@ -640,15 +634,6 @@ int main(int argc, char **argv)
}
break;
case 'm':
val = strtol(optarg, &end, 0);
if (val < 88 || val > 32767 || *end)
invalid = 1;
else {
dp->mss = val;
}
break;
case 'g':
val = strtol(optarg, &end, 0);
if (val <= 0 || val > 255 || *end)

View File

@ -49,7 +49,6 @@ struct desync_params {
int mod_http;
int tlsrec_n;
struct part *tlsrec;
int mss;
int spos_n;
struct spos *spos;
};

17
proxy.c
View File

@ -291,7 +291,7 @@ int s5_get_addr(char *buffer, ssize_t n,
int create_conn(struct poolhd *pool,
struct eval *val, struct sockaddr_ina *dst, int next, int mss)
struct eval *val, struct sockaddr_ina *dst, int next)
{
struct sockaddr_ina addr = *dst;
@ -332,12 +332,6 @@ int create_conn(struct poolhd *pool,
close(sfd);
return -1;
}
if (mss && setsockopt(sfd, IPPROTO_TCP,
TCP_MAXSEG, (char *)&mss, sizeof(mss))) {
uniperror("setsockopt TCP_MAXSEG");
close(sfd);
return -1;
}
#ifdef TCP_FASTOPEN_CONNECT
int yes = 1;
if (params.tfo && setsockopt(sfd, IPPROTO_TCP,
@ -582,16 +576,14 @@ static inline int on_request(struct poolhd *pool, struct eval *val,
}
return -1;
}
int m = mode_add_get(&dst, -1);
struct desync_params dp = params.dp[m < 0 ? 0 : m];
error = create_conn(pool, val, &dst, EV_CONNECT, dp.mss);
error = create_conn(pool, val, &dst, EV_CONNECT);
if (error) {
int en = get_e();
if (resp_error(val->fd, en ? en : error, val->flag) < 0)
uniperror("send");
return -1;
}
int m = mode_add_get(&dst, -1);
if (m >= 0) {
val->attempt = m;
}
@ -615,10 +607,9 @@ int try_again(struct poolhd *pool, struct eval *val, char data)
(struct sockaddr_ina *)&val->in6, 0);
return -1;
}
struct desync_params dp = params.dp[m];
if (create_conn(pool, client,
(struct sockaddr_ina *)&val->in6, EV_DESYNC, dp.mss)) {
(struct sockaddr_ina *)&val->in6, EV_DESYNC)) {
return -1;
}
val->pair = 0;