Skip to content

Commit 081b0cc

Browse files
committed
Increased maximum buffer size in network file transfers
1 parent 7137304 commit 081b0cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libsignal-service-dotnet/push/PushServiceSocket.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,11 +499,11 @@ private async Task DownloadAttachment(CancellationToken token, string url, Strea
499499
using (var resp = await connection.SendAsync(req, token))
500500
{
501501
Stream input = await resp.Content.ReadAsStreamAsync();
502-
byte[] buffer = new byte[4096];
502+
byte[] buffer = new byte[32768];
503503
int read = 0;
504504
while (true)
505505
{
506-
read = input.Read(buffer, 0, 4096);
506+
read = input.Read(buffer, 0, 32768);
507507
if (read == 0)
508508
{
509509
localDestination.Flush();
@@ -578,7 +578,7 @@ private async Task<byte[]> UploadAttachment(CancellationToken token, string meth
578578
using (var cryptoStream = new CryptoStream(memoryStream, encrypt, CryptoStreamMode.Write))
579579
{
580580
// Then read from the data stream and write it to the crypto stream
581-
byte[] buffer = new byte[4096];
581+
byte[] buffer = new byte[32768];
582582
int read = data.Read(buffer, 0, buffer.Length);
583583
while (read > 0)
584584
{

0 commit comments

Comments
 (0)