Skip to content

Finalmask: Refactor header conns to avoid multiple-copy; Add randRange to "header-custom" (TCP & UDP) - #5812

Merged
RPRX merged 9 commits into
XTLS:mainfrom
LjhAUMEM:manager
Mar 21, 2026
Merged

RPRX merged 9 commits into
XTLS:mainfrom
LjhAUMEM:manager

Conversation

@LjhAUMEM

@LjhAUMEM LjhAUMEM commented Mar 16, 2026 •

Copy link
Copy Markdown
Contributor
  • 防止 header conn 多次 copy
  • custom header rand range

#5657 (comment)
#5657 (comment)

@fatyzzz

fatyzzz commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

thanks

@RPRX

RPRX commented Mar 18, 2026

Copy link
Copy Markdown
Member

或许该叫 randbyte?

@LjhAUMEM

Copy link
Copy Markdown
Contributor Author

common/crypto 那个吗,我还不确定是遍历 rand.Int 还是 rand.Read 后再取模

@LjhAUMEM

Copy link
Copy Markdown
Contributor Author

infra 要不要改成 randLen randByte

@LjhAUMEM

Copy link
Copy Markdown
Contributor Author

crypt.RandBetween 左闭右开
crypt.RandBytesBetween 左闭右闭

嗯,很合理

保持和 RandBetween 一样左闭右开还不太好写,先这样吧

@RPRX

RPRX commented Mar 19, 2026

Copy link
Copy Markdown
Member

这个具体是啥效果来着,为啥 nil 默认等于 0-255

@LjhAUMEM

Copy link
Copy Markdown
Contributor Author

设置了 rand: 5 就会生成五个字节的随机,这个就限制随机的范围,比如限制在 ascll 内之类的

@RPRX

RPRX commented Mar 19, 2026

Copy link
Copy Markdown
Member

那改名成 randRange 吧

@RPRX RPRX changed the title Refactor: header conn Finalmask: Refactor header conns to avoid multiple-copy; Add randRange to "header-custom" Mar 20, 2026
@RPRX RPRX changed the title Finalmask: Refactor header conns to avoid multiple-copy; Add randRange to "header-custom" Finalmask: Refactor header conns to avoid multiple-copy; Add randRange to "header-custom" (TCP & UDP) Mar 20, 2026
@RPRX

RPRX commented Mar 20, 2026

Copy link
Copy Markdown
Member

@LjhAUMEM 配置没检测 0-255,虽然看代码不会 panic 但还是检测下报个错吧

@LjhAUMEM

Copy link
Copy Markdown
Contributor Author

@LjhAUMEM 配置没检测 0-255,虽然看代码不会 panic 但还是检测下报个错吧

github 还是有 bug,这条消息居然没发邮件,done

@RPRX
RPRX merged commit 06dc4cf into XTLS:main Mar 21, 2026
39 checks passed
RPRX pushed a commit that referenced this pull request Mar 27, 2026
@BrewTestBot BrewTestBot mentioned this pull request Mar 27, 2026
1 task done
keli-123456 pushed a commit to keli-123456/keli-core that referenced this pull request Mar 30, 2026
wyusgw pushed a commit to wyusgw/Xray-core that referenced this pull request Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants