Loading client/lib/snowflake.go +3 −2 Original line number Diff line number Diff line Loading @@ -6,11 +6,12 @@ import ( "log" "net" "sync" "time" ) const ( ReconnectTimeout = 10 SnowflakeTimeout = 30 ReconnectTimeout = 10 * time.Second SnowflakeTimeout = 30 * time.Second ) // Given an accepted SOCKS connection, establish a WebRTC connection to the Loading client/lib/webrtc.go +5 −5 Original line number Diff line number Diff line Loading @@ -117,9 +117,9 @@ func (c *WebRTCPeer) checkForStaleness() { if c.closed { return } if time.Since(c.lastReceive).Seconds() > SnowflakeTimeout { log.Println("WebRTC: No messages received for", SnowflakeTimeout, "seconds -- closing stale connection.") if time.Since(c.lastReceive) > SnowflakeTimeout { log.Printf("WebRTC: No messages received for %v -- closing stale connection.", SnowflakeTimeout) c.Close() return } Loading Loading @@ -314,8 +314,8 @@ func (c *WebRTCPeer) exchangeSDP() error { go c.sendOfferToBroker() answer, ok = <-c.answerChannel // Blocks... if !ok || nil == answer { log.Printf("Failed to retrieve answer. Retrying in %d seconds", ReconnectTimeout) <-time.After(time.Second * ReconnectTimeout) log.Printf("Failed to retrieve answer. Retrying in %v", ReconnectTimeout) <-time.After(ReconnectTimeout) answer = nil } } Loading client/snowflake.go +2 −2 Original line number Diff line number Diff line Loading @@ -31,11 +31,11 @@ func ConnectLoop(snowflakes sf.SnowflakeCollector) { // Check if ending is necessary. _, err := snowflakes.Collect() if err != nil { log.Printf("WebRTC: %v Retrying in %v seconds...", log.Printf("WebRTC: %v Retrying in %v...", err, sf.ReconnectTimeout) } select { case <-time.After(time.Second * sf.ReconnectTimeout): case <-time.After(sf.ReconnectTimeout): continue case <-snowflakes.Melted(): log.Println("ConnectLoop: stopped.") Loading Loading
client/lib/snowflake.go +3 −2 Original line number Diff line number Diff line Loading @@ -6,11 +6,12 @@ import ( "log" "net" "sync" "time" ) const ( ReconnectTimeout = 10 SnowflakeTimeout = 30 ReconnectTimeout = 10 * time.Second SnowflakeTimeout = 30 * time.Second ) // Given an accepted SOCKS connection, establish a WebRTC connection to the Loading
client/lib/webrtc.go +5 −5 Original line number Diff line number Diff line Loading @@ -117,9 +117,9 @@ func (c *WebRTCPeer) checkForStaleness() { if c.closed { return } if time.Since(c.lastReceive).Seconds() > SnowflakeTimeout { log.Println("WebRTC: No messages received for", SnowflakeTimeout, "seconds -- closing stale connection.") if time.Since(c.lastReceive) > SnowflakeTimeout { log.Printf("WebRTC: No messages received for %v -- closing stale connection.", SnowflakeTimeout) c.Close() return } Loading Loading @@ -314,8 +314,8 @@ func (c *WebRTCPeer) exchangeSDP() error { go c.sendOfferToBroker() answer, ok = <-c.answerChannel // Blocks... if !ok || nil == answer { log.Printf("Failed to retrieve answer. Retrying in %d seconds", ReconnectTimeout) <-time.After(time.Second * ReconnectTimeout) log.Printf("Failed to retrieve answer. Retrying in %v", ReconnectTimeout) <-time.After(ReconnectTimeout) answer = nil } } Loading
client/snowflake.go +2 −2 Original line number Diff line number Diff line Loading @@ -31,11 +31,11 @@ func ConnectLoop(snowflakes sf.SnowflakeCollector) { // Check if ending is necessary. _, err := snowflakes.Collect() if err != nil { log.Printf("WebRTC: %v Retrying in %v seconds...", log.Printf("WebRTC: %v Retrying in %v...", err, sf.ReconnectTimeout) } select { case <-time.After(time.Second * sf.ReconnectTimeout): case <-time.After(sf.ReconnectTimeout): continue case <-snowflakes.Melted(): log.Println("ConnectLoop: stopped.") Loading