Selaa lähdekoodia

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 kuukausi sitten
vanhempi
commit
1fcec38aea
1 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 6
    2
      mtglib/internal/dc/view.go

+ 6
- 2
mtglib/internal/dc/view.go Näytä tiedosto

@@ -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…
Peruuta
Tallenna