Skip to content

Commit

Permalink
Fix issue #24289
Browse files Browse the repository at this point in the history
  • Loading branch information
blueww committed Mar 1, 2024
1 parent 406941a commit 4232afb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/Storage/Storage.Management/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
- Additional information about change #1
-->
## Upcoming Release
* Fixed upload file with OAuth authentication issue [#24289]
- `Set-AzStorageFileContent`

* Fixed parser logic when downloading blob from managed disk account with Sas Uri and bearer token on Linux and MacOS
- `Get-AzStorageBlobContent`
* Added warning messages for upcoming breaking changes in Queue cmdlets for removing references to "Microsoft.Azure.Storage.Queue"
Expand Down
10 changes: 4 additions & 6 deletions src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,10 @@ await DataMovementTransferHelper.DoTransfer(() =>
{
long currentBlockSize = offset + blockSize < fileSize ? blockSize : fileSize - offset;

// Only need to create new buffer when chunk size change
if (currentBlockSize != lastBlockSize)
{
buffer = new byte[currentBlockSize];
lastBlockSize = currentBlockSize;
}
// create new buffer, the old buffer will be GC
buffer = new byte[currentBlockSize];
lastBlockSize = currentBlockSize;

await stream.ReadAsync(buffer: buffer, offset: 0, count: (int)currentBlockSize);
if (!fipsEnabled && hash != null)
{
Expand Down

0 comments on commit 4232afb

Please sign in to comment.