瀏覽代碼

Change IP address set priority

For a couple of releases we use collected IPs as a prioritized source
for connecting to Telegram. But apparently, they work way worse than it
should, and having connectivity to core ip ALWAYS gives better results.
Thus, this PR flips priorities, so users could have auto-update enabled
as a source of secondary addresses, not primary ones
tags/v2.2.7^2^2
9seconds 1 月之前
父節點
當前提交
1fcec38aea
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6
    2
      mtglib/internal/dc/view.go

+ 6
- 2
mtglib/internal/dc/view.go 查看文件

@@ -5,15 +5,19 @@ type dcView struct {
5 5
 }
6 6
 
7 7
 func (d dcView) getV4(dc int) []Addr {
8
-	addrs := d.publicConfigs.getV4(dc)
8
+	var addrs []Addr
9
+
9 10
 	addrs = append(addrs, defaultDCAddrSet.getV4(dc)...)
11
+	addrs = append(addrs, d.publicConfigs.getV4(dc)...)
10 12
 
11 13
 	return addrs
12 14
 }
13 15
 
14 16
 func (d dcView) getV6(dc int) []Addr {
15
-	addrs := d.publicConfigs.getV6(dc)
17
+	var addrs []Addr
18
+
16 19
 	addrs = append(addrs, defaultDCAddrSet.getV6(dc)...)
20
+	addrs = append(addrs, d.publicConfigs.getV6(dc)...)
17 21
 
18 22
 	return addrs
19 23
 }

Loading…
取消
儲存