mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-08 14:13:22 +00:00
fix: tighten browser URL collection order and error handling
Agent-Logs-Url: https://github.com/XTLS/Xray-core/sessions/84d72770-6ad0-447a-8d86-94d692972a05 Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
be9a229d68
commit
bb79f554dd
@@ -1995,7 +1995,9 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
browser_dialer.RegisterDialerProxyURL(c.SocketSettings.DialerProxy)
|
||||
if err := browser_dialer.RegisterDialerProxyURL(c.SocketSettings.DialerProxy); err != nil {
|
||||
return nil, errors.New("failed to collect browser dialer url.").Base(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,16 +75,17 @@ func BeginCollectingDialerProxyURLs() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func RegisterDialerProxyURL(raw string) {
|
||||
func RegisterDialerProxyURL(raw string) error {
|
||||
if !IsBrowserDialerProxy(raw) {
|
||||
return
|
||||
return nil
|
||||
}
|
||||
initMu.Lock()
|
||||
defer initMu.Unlock()
|
||||
if pendingURLs == nil {
|
||||
pendingURLs = map[string]struct{}{}
|
||||
return errors.New("browser dialer url collection is not initialized")
|
||||
}
|
||||
pendingURLs[raw] = struct{}{}
|
||||
return nil
|
||||
}
|
||||
|
||||
func ConfigureCollectedDialerProxyURLs() error {
|
||||
|
||||
Reference in New Issue
Block a user