fix: correct include URL handling and limiter cleanup#9
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Include,在节点热重载时删除 limiter 时避免删除到新 tag,以及修正 outbound handler 的错误提示文案。Description
conf/node.go中用strings.HasPrefix(rn.Include, "http://")/strings.HasPrefix(rn.Include, "https://")判断远程 Include 并调用http.Get(rn.Include),本地路径仍使用os.Open(rn.Include),保持原有反序列化流程不变。node/task.go中在修改c.tag之前保存oldTag := c.tag,并改为limiter.DeleteLimiter(oldTag),其余逻辑不变以确保热重载时删除的是旧 limiter。core/xray/node.go中将 outbound 创建失败的错误文案从"not an InboundHandler"改为"not an OutboundHandler"。Testing
gofmt -w conf/node.go node/task.go core/xray/node.go并保存格式化结果。go test ./...,仓库内可运行的包均通过测试(测试结果显示ok)。go build ./...,构建成功且未报错。Codex Task