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" " -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" " -M, --mod-http <h,d,r> Modify HTTP: hcsmix,dcsmix,rmspace\n"
" -r, --tlsrec <n[+s]> Make TLS record at position\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'}, {"mod-http", 1, 0, 'M'},
{"tlsrec", 1, 0, 'r'}, {"tlsrec", 1, 0, 'r'},
{"def-ttl", 1, 0, 'g'}, {"def-ttl", 1, 0, 'g'},
#ifdef __linux__
{"mss", 1, 0, 'm'},
#endif
{"delay", 1, 0, 'w'}, // {"delay", 1, 0, 'w'}, //
{"not-wait-send", 0, 0, 'W'}, // {"not-wait-send", 0, 0, 'W'}, //
{0} {0}
@ -640,15 +634,6 @@ int main(int argc, char **argv)
} }
break; break;
case 'm':
val = strtol(optarg, &end, 0);
if (val < 88 || val > 32767 || *end)
invalid = 1;
else {
dp->mss = val;
}
break;
case 'g': case 'g':
val = strtol(optarg, &end, 0); val = strtol(optarg, &end, 0);
if (val <= 0 || val > 255 || *end) if (val <= 0 || val > 255 || *end)

View File

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