]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virStreamSparseSendAll: Reset @want in each iteration
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 22 May 2017 09:44:26 +0000 (11:44 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 22 May 2017 13:25:39 +0000 (15:25 +0200)
commit9b991d023709431edd922c9c5b23c1c27b043b8b
tree3abe005f2598c1cbb65e5643394fe8fecf8ec03e
parentf9fe0f54ca8a08a59616855cfd8027ed9dea9e48
virStreamSparseSendAll: Reset @want in each iteration

There's a slight problem with the current function. Assume we are
currently in a data section and we have say 42 bytes until next
section. Therefore, just before (handler) is called to fill up
the buffer with data, @want is changed to 42 to match the amount
of data left in the current section. However, after hole is
processed, we are back in data section but with incredibly small
@want size. Nobody will ever reset it back. This results in
incredible data fragmentation.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/libvirt-stream.c