Simplify memory handling

This commit is contained in:
Jakob Borg
2014-06-18 23:57:22 +02:00
parent b05fcbc9d7
commit 4dbce32738
6 changed files with 8 additions and 66 deletions

View File

@@ -14,7 +14,6 @@ import (
"time"
"github.com/calmh/syncthing/beacon"
"github.com/calmh/syncthing/buffers"
)
type Discoverer struct {
@@ -329,11 +328,8 @@ func (d *Discoverer) externalLookup(node string) []string {
}
return nil
}
buffers.Put(buf)
buf = buffers.Get(2048)
defer buffers.Put(buf)
buf = make([]byte, 2048)
n, err := conn.Read(buf)
if err != nil {
if err, ok := err.(net.Error); ok && err.Timeout() {