[master] CA-375556: Pass non-compressed file stream to HTTP.CopyStream (#3115)

* CA-375556: Pass non-compressed file stream to `HTTP.CopyStream`

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>

* CA-375556: Use `sourcefile` instead of `filePath`

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>

---------

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
This commit is contained in:
Danilo Del Busso 2023-03-24 10:24:10 +00:00 committed by GitHub
parent 8ede70ff99
commit 65da63755f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,7 +318,7 @@ namespace XenAdmin.Actions.OvfActions
{
vhdDisk = VirtualDisk.OpenDisk(sourcefile, FileAccess.Read);
virtualSize = vhdDisk.Capacity;
dataStream = File.OpenRead(filePath);
dataStream = File.OpenRead(sourcefile);
dataLength = dataStream.Length;
format = "&format=vhd";
}
@ -330,7 +330,7 @@ namespace XenAdmin.Actions.OvfActions
return null;
}
dataStream = File.OpenRead(filePath);
dataStream = File.OpenRead(sourcefile);
dataLength = virtualSize = dataStream.Length;
}
else if (VirtualDisk.SupportedDiskFormats.Any(f => ext.ToLower().EndsWith(f.ToLower())))