service/content: fix logic error on storing extra data

Clarify logic that extra data is stored when the target
buffer is full. Existing logic allows for extra data to
be stored even when more data will be read into buffer
when the remaining space is less than what was copied
from the last receive.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2017-06-05 13:50:56 -07:00
parent bf2fee2da1
commit 73763b954f

View File

@@ -34,12 +34,10 @@ func (rr *remoteReader) Read(p []byte) (n int, err error) {
n += copied n += copied
p = p[copied:] p = p[copied:]
if copied < len(p) { if len(p) == 0 {
continue
}
rr.extra = append(rr.extra, resp.Data[copied:]...) rr.extra = append(rr.extra, resp.Data[copied:]...)
} }
}
return return
} }