Skip to content

Commit

Permalink
Minor tweak to prefer using using a Memory
Browse files Browse the repository at this point in the history
Signed-off-by: Whit Waldo <[email protected]>
  • Loading branch information
WhitWaldo committed Jan 4, 2024
1 parent be3e1fd commit 2da2bb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/Dapr.Client/DaprClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,7 @@ public abstract Task<ReadOnlyMemory<byte>> DecryptAsync(string vaultResourceName
/// <param name="keyName">The name of the key to use from the Vault for the decryption operation.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the operation.</param>
/// <returns>An array of decrypted bytes.</returns>
[Obsolete(
"The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")]
[Obsolete("The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")]
public abstract Task<ReadOnlyMemory<byte>> DecryptAsync(string vaultResourceName,
ReadOnlyMemory<byte> ciphertextBytes, string keyName, CancellationToken cancellationToken = default);

Expand Down
4 changes: 2 additions & 2 deletions src/Dapr.Client/DaprClientGrpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ await duplexStream.RequestStream.WriteAsync(
ulong sequenceNumber = 0;

while ((bytesRead =
await bufferedStream.ReadAsync(buffer, 0, streamingBlockSizeInBytes, cancellationToken)) !=
await bufferedStream.ReadAsync(buffer.AsMemory(0, streamingBlockSizeInBytes), cancellationToken)) !=
0)
{
await duplexStream.RequestStream.WriteAsync(
Expand Down Expand Up @@ -1608,7 +1608,7 @@ await duplexStream.RequestStream.WriteAsync(
int bytesRead;
ulong sequenceNumber = 0;

while ((bytesRead = await bufferedStream.ReadAsync(buffer, 0, streamingBlockSizeInBytes, cancellationToken)) != 0)
while ((bytesRead = await bufferedStream.ReadAsync(buffer.AsMemory(0, streamingBlockSizeInBytes), cancellationToken)) != 0)
{
await duplexStream.RequestStream.WriteAsync(new Autogenerated.DecryptRequest
{
Expand Down

0 comments on commit 2da2bb6

Please sign in to comment.