This is an automated email from the git hooks/post-receive script.
cohosh pushed a change to branch main in repository pluggable-transports/snowflake.
from 56063ef Merge remote-tracking branch 'gitlab/mr/102' new c5b291b proxy: Fix build with golang 1.13 new 986fc82 proxy: Correctly handle argument parsing error
The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
Summary of changes: proxy/main.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
This is an automated email from the git hooks/post-receive script.
cohosh pushed a commit to branch main in repository pluggable-transports/snowflake.
commit c5b291b114752cd287a6bf1910f159be537f15fe Author: KokaKiwi kokakiwi+tor@kokakiwi.net AuthorDate: Wed Oct 12 16:33:09 2022 +0200
proxy: Fix build with golang 1.13 --- proxy/main.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/proxy/main.go b/proxy/main.go index a6e6a19..e9bc0b2 100644 --- a/proxy/main.go +++ b/proxy/main.go @@ -1,7 +1,6 @@ package main
import ( - "errors" "flag" "fmt" "io" @@ -32,31 +31,32 @@ func main() { SummaryInterval := flag.Duration("summary-interval", time.Hour, "the time interval to output summary, 0s disables summaries. Valid time units are "s", "m", "h". ") verboseLogging := flag.Bool("verbose", false, "increase log verbosity") + ephemeralPortsRangeFlag := flag.String("ephemeral-ports-range", "ICE UDP ephemeral ports range (format:"[min]:[max]")", "") + var ephemeralPortsRange []uint16 = []uint16{0, 0} - flag.Func("ephemeral-ports-range", "ICE UDP ephemeral ports range (format: "[min]:[max]")", func(s string) error { - ephemeralPortsRangeParts := strings.Split(s, ":") + + flag.Parse() + + eventLogger := event.NewSnowflakeEventDispatcher() + + if *ephemeralPortsRangeFlag != "" { + ephemeralPortsRangeParts := strings.Split(*ephemeralPortsRangeFlag, ":") if len(ephemeralPortsRangeParts) == 2 { ephemeralMinPort, err := strconv.ParseUint(ephemeralPortsRangeParts[0], 10, 16) if err != nil { - return err + fmt.Printf("Error parsing range port: %v", err) }
ephemeralMaxPort, err := strconv.ParseUint(ephemeralPortsRangeParts[1], 10, 16) if err != nil { - return err + fmt.Printf("Error parsing range port: %v", err) }
ephemeralPortsRange = []uint16{uint16(ephemeralMinPort), uint16(ephemeralMaxPort)} - - return nil }
- return errors.New(fmt.Sprintf("Bad range port format: %v", s)) - }) - - flag.Parse() - - eventLogger := event.NewSnowflakeEventDispatcher() + fmt.Printf("Bad range port format: %v", ephemeralPortsRangeFlag) + }
proxy := sf.SnowflakeProxy{ Capacity: uint(*capacity),
This is an automated email from the git hooks/post-receive script.
cohosh pushed a commit to branch main in repository pluggable-transports/snowflake.
commit 986fc8269a804f5b7f223b71ae1c28f718bbf8f1 Author: KokaKiwi kokakiwi+tor@kokakiwi.net AuthorDate: Wed Oct 12 16:51:39 2022 +0200
proxy: Correctly handle argument parsing error --- proxy/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/proxy/main.go b/proxy/main.go index e9bc0b2..38c07b0 100644 --- a/proxy/main.go +++ b/proxy/main.go @@ -44,12 +44,12 @@ func main() { if len(ephemeralPortsRangeParts) == 2 { ephemeralMinPort, err := strconv.ParseUint(ephemeralPortsRangeParts[0], 10, 16) if err != nil { - fmt.Printf("Error parsing range port: %v", err) + log.Fatal(err) }
ephemeralMaxPort, err := strconv.ParseUint(ephemeralPortsRangeParts[1], 10, 16) if err != nil { - fmt.Printf("Error parsing range port: %v", err) + log.Fatal(err) }
ephemeralPortsRange = []uint16{uint16(ephemeralMinPort), uint16(ephemeralMaxPort)}
tor-commits@lists.torproject.org