Skip to content
Permalink
Browse files
Remove unused initialisation code
  • Loading branch information
shaneHowearth committed Sep 23, 2019
1 parent 99a0fdf commit 9d6fabee2c6596fcf72518f31188219b66576525
Showing with 5 additions and 6 deletions.
  1. +1 −1 client/lib/peers.go
  2. +1 −2 client/lib/util.go
  3. +1 −1 client/lib/webrtc.go
  4. +2 −2 client/snowflake.go
@@ -44,7 +44,7 @@ func (p *Peers) Collect() (Snowflake, error) {
cnt := p.Count()
s := fmt.Sprintf("Currently at [%d/%d]", cnt, p.capacity)
if cnt >= p.capacity {
s := fmt.Sprintf("At capacity [%d/%d]", cnt, p.capacity)
s = fmt.Sprintf("At capacity [%d/%d]", cnt, p.capacity)
return nil, errors.New(s)
}
log.Println("WebRTC: Collecting a new Snowflake.", s)
@@ -60,9 +60,8 @@ func (b *BytesSyncLogger) Log() {
case amount = <-b.OutboundChan:
b.Outbound += amount
b.OutEvents++
last := time.Now()
last = time.Now()
if time.Since(last) > time.Second*LogTimeInterval {
last = time.Now()
output()
}
case amount = <-b.InboundChan:
@@ -298,7 +298,7 @@ func (c *WebRTCPeer) exchangeSDP() error {
}
// Keep trying the same offer until a valid answer arrives.
var ok bool
var answer *webrtc.SessionDescription = nil
var answer *webrtc.SessionDescription
for nil == answer {
go c.sendOfferToBroker()
answer, ok = <-c.answerChannel // Blocks...
@@ -83,7 +83,7 @@ func main() {
// deadlock because the buffer is full.
// https://bugs.torproject.org/26360
// https://bugs.torproject.org/25600#comment:14
var logOutput io.Writer = ioutil.Discard
var logOutput = ioutil.Discard
if *logFilename != "" {
if *logToStateDir {
stateDir, err := pt.MakeStateDir()
@@ -169,7 +169,7 @@ func main() {
}
pt.CmethodsDone()

var numHandlers int = 0
var numHandlers int
var sig os.Signal
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGTERM)

0 comments on commit 9d6fabe

Please sign in to comment.