mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Move handling of -ice option into main.
Rather than having it happen as a side effect of flag parsing. Having it happen as a side effect of flag parsing caused log messages related to handling the option (e.g. "IceServerList:") to always go to stderr, despite the presence of a -log option. This is because the requested log file had not been opened yet.
This commit is contained in:
parent
8dcd337ce4
commit
0c02af35d0
2 changed files with 11 additions and 15 deletions
|
@ -1,9 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/keroserene/go-webrtc"
|
||||
|
@ -19,17 +17,6 @@ func (i *IceServerList) String() string {
|
|||
return fmt.Sprint(*i)
|
||||
}
|
||||
|
||||
func (i *IceServerList) Set(s string) error {
|
||||
log.Println("IceServerList:")
|
||||
for _, server := range strings.Split(s, ",") {
|
||||
// TODO: STUN / TURN url format validation?
|
||||
log.Println(server)
|
||||
option := webrtc.OptionIceServer(server)
|
||||
*i = append(*i, option)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type BytesLogger interface {
|
||||
Log()
|
||||
AddOutbound(int)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue