rewrite dns notify mechanism #558
Merged
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.
在MIUI上发现,各个network的available和lost是互相独立的,会出现cellular available -> wifi available -> cellular unavailable -> cellular available这样的时序,按现有代码,cellular的变化会污染wifi的结果,导致wifi状态下dns却改成了cellular的,导致网络不通。没有用户报告的原因是在所有dns都不通时会默认去用default nameserver,但对于wifi是公司网络且需要公司内部dns解析场景,就会导致页面无法打开。
这里重新实现了dns感知机制,将每个network的dns状况单独保存,并按自定义的优先级在多个network之间获取dns,来规避这个问题。