diff --git a/main.c b/main.c index 6b47bfe..e88c5da 100644 --- a/main.c +++ b/main.c @@ -95,9 +95,6 @@ const char help_text[] = { " -e, --oob-data Set custom OOB data, filename or :string\n" " -M, --mod-http Modify HTTP: hcsmix,dcsmix,rmspace\n" " -r, --tlsrec Make TLS record at position\n" - #ifdef __linux__ - " -m, --mss 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) diff --git a/params.h b/params.h index c52ccd1..f3855c9 100644 --- a/params.h +++ b/params.h @@ -49,7 +49,6 @@ struct desync_params { int mod_http; int tlsrec_n; struct part *tlsrec; - int mss; int spos_n; struct spos *spos; }; diff --git a/proxy.c b/proxy.c index 81a9f1d..575271c 100644 --- a/proxy.c +++ b/proxy.c @@ -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;