mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
Check if multiple front domains argument is empty
This fixes a regression introduced in 9fdfb3d1
, where the list of front
domains always contained an empty string if none were supplied via the
commandline options, causing rendezvous failures for both amp cache and
domain fronting. This fix checks to see whether the commandline option
was supplied.
This commit is contained in:
parent
778e3af09a
commit
10fb9afaa7
1 changed files with 8 additions and 2 deletions
|
@ -82,7 +82,9 @@ func socksAcceptLoop(ln *pt.SocksListener, config sf.ClientConfig, shutdown chan
|
|||
config.AmpCacheURL = arg
|
||||
}
|
||||
if arg, ok := conn.Req.Args.Get("fronts"); ok {
|
||||
config.FrontDomains = strings.Split(strings.TrimSpace(arg), ",")
|
||||
if arg != "" {
|
||||
config.FrontDomains = strings.Split(strings.TrimSpace(arg), ",")
|
||||
}
|
||||
} else if arg, ok := conn.Req.Args.Get("front"); ok {
|
||||
config.FrontDomains = strings.Split(strings.TrimSpace(arg), ",")
|
||||
}
|
||||
|
@ -210,7 +212,11 @@ func main() {
|
|||
log.Printf("snowflake-client %s\n", version.GetVersion())
|
||||
|
||||
iceAddresses := strings.Split(strings.TrimSpace(*iceServersCommas), ",")
|
||||
frontDomains := strings.Split(strings.TrimSpace(*frontDomainsCommas), ",")
|
||||
|
||||
var frontDomains []string
|
||||
if *frontDomainsCommas != "" {
|
||||
frontDomains = strings.Split(strings.TrimSpace(*frontDomainsCommas), ",")
|
||||
}
|
||||
|
||||
// Maintain backwards compatability with legacy commandline option
|
||||
if (len(frontDomains) == 0) && (*frontDomain != "") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue