Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复切换节点时打断连接没按代码的预期生效 #280

Closed
wants to merge 1 commit into from

Conversation

szkzn
Copy link

@szkzn szkzn commented Jul 30, 2024

  • 增加调用 c.Close() 的前置检查和转换,改为 type assertion c.(C.Conn)
  • 修复 statistic.Tracker 类型没有 Close() 方法时无法正常工作,最终原代码的关闭连接行为失效
    Snipaste_2024-07-29_04-59-39
    Snipaste_2024-07-29_05-02-01

经测试,编译后在 Andorid 12 上正常运行,已按原代码预期行为生效,切换节点后立刻打断连接实时生效新节点
编译成品 app 测试:
https://dl.0z.gs/d/temp/cmfa-alpha-2.10.2_fixBreakConnect.zip?sign=hWitMWFflZoABM0LC5oZJEs25GogGa9LSBgqVUXNyi0=:0

@wwqgtxx
Copy link

wwqgtxx commented Jul 30, 2024

@szkzn
Copy link
Author

szkzn commented Jul 30, 2024

那大佬能修一下吗,其他客户端都有这个功能,我这代码瞎写的,能跑就行这种
我是实在被折磨的才提个pr
典型场景:切节点不生效
国外代理的分流策略分组(同分组),节点 A 切到 Direct 依然能访问谷歌这种
但是如果是从 Direct 切到 节点 A(同分组),能立刻生效
正常节点互切换(同一个策略组),可能没有长连接 keep-alive状态(简单的一个网页访问),也是无法生效的

@wwqgtxx
Copy link

wwqgtxx commented Jul 30, 2024

等会,我在改#248

@wwqgtxx wwqgtxx closed this Jul 30, 2024
@szkzn
Copy link
Author

szkzn commented Jul 30, 2024

以上行为在 cfa 2.5.12 不会复现,实时生效,希望能提供类似 cfw / clash verge 的这种功能,我也去 clash mihomo 提了,群里讨论倾向于 客户端 GUI 实现

@szkzn
Copy link
Author

szkzn commented Jul 30, 2024

感谢感谢!
我感觉是个BUG,因为都是fork cfa 的,cmfa fork 时的 commit 也就落后 kr328 大佬的 14个 commits

@wwqgtxx
Copy link

wwqgtxx commented Jul 30, 2024

试试最新的 Prerelease

@szkzn
Copy link
Author

szkzn commented Jul 30, 2024

经过多个场景测试,完美修复了,感谢!

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.

2 participants