Group erasure shares before sending them to storage nodes (#210)
This commit is contained in:
parent
80c0a0ed2b
commit
34629e5b80
@ -4,6 +4,7 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
@ -76,9 +77,12 @@ func (client *Client) Put(ctx context.Context, id PieceID, data io.Reader, ttl t
|
||||
}
|
||||
}()
|
||||
|
||||
_, err = io.Copy(writer, data)
|
||||
|
||||
bufw := bufio.NewWriterSize(writer, 32*1024)
|
||||
_, err = io.Copy(bufw, data)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return bufw.Flush()
|
||||
}
|
||||
|
||||
// Get begins downloading a Piece from a piece store Server
|
||||
|
Loading…
Reference in New Issue
Block a user