mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-22 23:13:01 +00:00
Make necessary maps in non-empty names before copy
This commit is contained in:
parent
f0efc0cfde
commit
88f6537540
@ -109,6 +109,17 @@ func New(ctx context.Context, config *Config, dc dns.Client) (*Handler, error) {
|
||||
}
|
||||
*/
|
||||
}
|
||||
if handler.fallbacks[""] != nil {
|
||||
for name, apfb := range handler.fallbacks {
|
||||
if name != "" {
|
||||
for alpn := range handler.fallbacks[""] {
|
||||
if apfb[alpn] == nil {
|
||||
apfb[alpn] = make(map[string]*Fallback)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, apfb := range handler.fallbacks {
|
||||
if apfb[""] != nil {
|
||||
for alpn, pfb := range apfb {
|
||||
@ -126,9 +137,6 @@ func New(ctx context.Context, config *Config, dc dns.Client) (*Handler, error) {
|
||||
for name, apfb := range handler.fallbacks {
|
||||
if name != "" {
|
||||
for alpn, pfb := range handler.fallbacks[""] {
|
||||
if apfb[alpn] == nil {
|
||||
apfb[alpn] = make(map[string]*Fallback)
|
||||
}
|
||||
for path, fb := range pfb {
|
||||
if apfb[alpn][path] == nil {
|
||||
apfb[alpn][path] = fb
|
||||
|
Loading…
Reference in New Issue
Block a user