Browse Source

Improve/fix buffer handling

Jakob Borg 12 years ago
parent
commit
223bdbb9aa
2 changed files with 1 additions and 2 deletions
  1. 1 1
      discover/discover.go
  2. 0 1
      model.go

+ 1 - 1
discover/discover.go

@@ -238,7 +238,7 @@ func (d *Discoverer) externalLookup(node string) (string, bool) {
 		return "", false
 	}
 
-	var buf = buffers.Get(1024)
+	var buf = buffers.Get(256)
 	defer buffers.Put(buf)
 
 	n, err := conn.Read(buf)

+ 0 - 1
model.go

@@ -491,7 +491,6 @@ func fileFromFileInfo(f protocol.FileInfo) File {
 			Length: b.Length,
 			Hash:   b.Hash,
 		})
-		buffers.Put(b.Hash)
 		offset += uint64(b.Length)
 	}
 	return File{