commit bbb5a6aca2c586fa772b710a5d4edd98f3ac472b Author: Arlo Breault arlolar@gmail.com Date: Wed Oct 18 11:13:25 2017 -0400
webrtc.NewIceServer already does this split / validation
It also expects to be called with a non-empty string, which isn't the case with this Split which always envokes the loop at least once. If -ice was omitted, an error was logged. --- client/snowflake.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/client/snowflake.go b/client/snowflake.go index 647e40e..b958a7f 100644 --- a/client/snowflake.go +++ b/client/snowflake.go @@ -145,11 +145,8 @@ func main() { log.Println("\n\n\n --- Starting Snowflake Client ---")
var iceServers IceServerList - log.Println("IceServerList:") - for _, server := range strings.Split(*iceServersCommas, ",") { - // TODO: STUN / TURN url format validation? - log.Println(server) - option := webrtc.OptionIceServer(server) + if len(strings.TrimSpace(*iceServersCommas)) > 0 { + option := webrtc.OptionIceServer(*iceServersCommas) iceServers = append(iceServers, option) }
tor-commits@lists.torproject.org