Improve/fix buffer handling

This commit is contained in:
Jakob Borg 2013-12-30 15:06:44 -05:00
parent 726afc915a
commit 223bdbb9aa
2 changed files with 1 additions and 2 deletions

View File

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

View File

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