packer/rpc: write only the remaining data on muxconn retry

This commit is contained in:
Mitchell Hashimoto 2014-01-01 22:20:03 -08:00
parent 84541c670b
commit e6fb71d14f
1 changed files with 1 additions and 1 deletions

View File

@ -445,7 +445,7 @@ func (m *MuxConn) write(from muxPacketFrom, id uint32, dataType muxPacketType, p
n := 0
for n < len(p) {
var n2 int
n2, err = m.rwc.Write(p)
n2, err = m.rwc.Write(p[n:])
n += n2
if err != nil {
log.Printf("[ERR] %p: Stream %d (%s) write error: %s", m, id, from, err)