aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2014-09-04 22:07:59 +0200
committerJakob Borg <jakob@nym.se>2014-09-04 22:07:59 +0200
commita40217cf077ba03efdd2718f213d8a99e3111ad1 (patch)
treedbee8f909d6bf8826dc3ac96f0e4a4c36d6624cc
parente586fda5f2956d7db0913292ec83b19f170fdf26 (diff)
downloadsyncthing-a40217cf077ba03efdd2718f213d8a99e3111ad1.tar.gz
syncthing-a40217cf077ba03efdd2718f213d8a99e3111ad1.zip
Trim dead bits of code
-rw-r--r--beacon/beacon.go5
-rw-r--r--beacon/broadcast.go1
-rw-r--r--beacon/multicast.go1
-rw-r--r--cmd/syncthing/gui.go2
-rw-r--r--discover/discover.go6
-rw-r--r--model/model.go10
-rw-r--r--protocol/protocol.go3
7 files changed, 0 insertions, 28 deletions
diff --git a/beacon/beacon.go b/beacon/beacon.go
index fd4bc162c..5af7d7b28 100644
--- a/beacon/beacon.go
+++ b/beacon/beacon.go
@@ -11,11 +11,6 @@ type recv struct {
src net.Addr
}
-type dst struct {
- intf string
- conn *net.UDPConn
-}
-
type Interface interface {
Send(data []byte)
Recv() ([]byte, net.Addr)
diff --git a/beacon/broadcast.go b/beacon/broadcast.go
index 94067892e..075c98a74 100644
--- a/beacon/broadcast.go
+++ b/beacon/broadcast.go
@@ -9,7 +9,6 @@ import "net"
type Broadcast struct {
conn *net.UDPConn
port int
- conns []dst
inbox chan []byte
outbox chan recv
}
diff --git a/beacon/multicast.go b/beacon/multicast.go
index 586393231..e018459c2 100644
--- a/beacon/multicast.go
+++ b/beacon/multicast.go
@@ -9,7 +9,6 @@ import "net"
type Multicast struct {
conn *net.UDPConn
addr *net.UDPAddr
- conns []dst
inbox chan []byte
outbox chan recv
}
diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go
index 047f8b9d3..8624d120c 100644
--- a/cmd/syncthing/gui.go
+++ b/cmd/syncthing/gui.go
@@ -11,7 +11,6 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
- "log"
"math/rand"
"mime"
"net"
@@ -45,7 +44,6 @@ var (
configInSync = true
guiErrors = []guiError{}
guiErrorsMut sync.Mutex
- static func(http.ResponseWriter, *http.Request, *log.Logger)
apiKey string
modt = time.Now().UTC().Format(http.TimeFormat)
eventSub *events.BufferedSubscription
diff --git a/discover/discover.go b/discover/discover.go
index 7dcae80f0..f4cd98ee8 100644
--- a/discover/discover.go
+++ b/discover/discover.go
@@ -38,7 +38,6 @@ type Discoverer struct {
forcedBcastTick chan time.Time
extAnnounceOK bool
extAnnounceOKmut sync.Mutex
- globalBcastStop chan bool
}
type cacheEntry struct {
@@ -50,11 +49,6 @@ var (
ErrIncorrectMagic = errors.New("incorrect magic number")
)
-// We tolerate a certain amount of errors because we might be running on
-// laptops that sleep and wake, have intermittent network connectivity, etc.
-// When we hit this many errors in succession, we stop.
-const maxErrors = 30
-
func NewDiscoverer(id protocol.NodeID, addresses []string) *Discoverer {
return &Discoverer{
myID: id,
diff --git a/model/model.go b/model/model.go
index 2c629b1e8..548127af8 100644
--- a/model/model.go
+++ b/model/model.go
@@ -50,12 +50,6 @@ func (s repoState) String() string {
}
}
-// Somewhat arbitrary amount of bytes that we choose to let represent the size
-// of an unsynchronized directory entry or a deleted file. We need it to be
-// larger than zero so that it's visible that there is some amount of bytes to
-// transfer to bring the systems into synchronization.
-const zeroEntrySize = 128
-
// How many files to send in each Index/IndexUpdate message.
const (
indexTargetSize = 250 * 1024 // Aim for making index messages no larger than 250 KiB (uncompressed)
@@ -89,9 +83,6 @@ type Model struct {
nodeVer map[protocol.NodeID]string
pmut sync.RWMutex // protects protoConn and rawConn
- sentLocalVer map[protocol.NodeID]map[string]uint64
- slMut sync.Mutex
-
addedRepo bool
started bool
}
@@ -122,7 +113,6 @@ func NewModel(indexDir string, cfg *config.Configuration, nodeName, clientName,
protoConn: make(map[protocol.NodeID]protocol.Connection),
rawConn: make(map[protocol.NodeID]io.Closer),
nodeVer: make(map[protocol.NodeID]string),
- sentLocalVer: make(map[protocol.NodeID]map[string]uint64),
}
for _, node := range cfg.Nodes {
diff --git a/protocol/protocol.go b/protocol/protocol.go
index 19a144ec6..1f1d789fb 100644
--- a/protocol/protocol.go
+++ b/protocol/protocol.go
@@ -5,7 +5,6 @@
package protocol
import (
- "bufio"
"encoding/binary"
"encoding/hex"
"errors"
@@ -86,9 +85,7 @@ type rawConnection struct {
state int
cr *countingReader
-
cw *countingWriter
- wb *bufio.Writer
awaiting [4096]chan asyncResult
awaitingMut sync.Mutex