fix(xo-server/vhd/createReadStream): emit empty if missing sectors
This commit is contained in:
parent
9c75992fe4
commit
4bc348f39f
@ -942,7 +942,9 @@ export const createReadStream = asyncIteratorToStream(function * (handler, path)
|
|||||||
const vhd = vhds[iVhd]
|
const vhd = vhds[iVhd]
|
||||||
const isRootVhd = vhd.footer.diskType === HARD_DISK_TYPE_DYNAMIC
|
const isRootVhd = vhd.footer.diskType === HARD_DISK_TYPE_DYNAMIC
|
||||||
if (!vhd.containsBlock(iBlock)) {
|
if (!vhd.containsBlock(iBlock)) {
|
||||||
if (!isRootVhd) {
|
if (isRootVhd) {
|
||||||
|
yield Buffer.alloc((n - i) * VHD_SECTOR_SIZE)
|
||||||
|
} else {
|
||||||
yield * emitBlockSectors(iVhd + 1, i, n)
|
yield * emitBlockSectors(iVhd + 1, i, n)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user