Fix GetMemory to not pass in size hint

This commit is contained in:
Justin Kotalik 2019-02-15 17:37:33 -08:00 committed by Chris Ross
parent 69a463c709
commit 49a720c1dc
2 changed files with 5 additions and 5 deletions

View File

@ -476,7 +476,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
var response = httpContext.Response;
await response.StartAsync();
var memory = response.BodyPipe.GetMemory(5000); // This will return 4089
var memory = response.BodyPipe.GetMemory(); // This will return 4089
var fisrtPartOfResponse = Encoding.ASCII.GetBytes(new string('a', memory.Length));
fisrtPartOfResponse.CopyTo(memory);
response.BodyPipe.Advance(memory.Length);
@ -525,7 +525,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
await response.BodyPipe.FlushAsync();
var memory = response.BodyPipe.GetMemory(5000); // This will return 4089
var memory = response.BodyPipe.GetMemory(); // This will return 4089
var fisrtPartOfResponse = Encoding.ASCII.GetBytes(new string('a', memory.Length));
fisrtPartOfResponse.CopyTo(memory);
response.BodyPipe.Advance(memory.Length);

View File

@ -2530,7 +2530,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
var response = httpContext.Response;
await response.StartAsync();
var memory = response.BodyPipe.GetMemory(5000);
var memory = response.BodyPipe.GetMemory();
Assert.Equal(4096, memory.Length);
var fisrtPartOfResponse = Encoding.ASCII.GetBytes(new string('a', memory.Length));
fisrtPartOfResponse.CopyTo(memory);
@ -2584,7 +2584,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
await response.BodyPipe.FlushAsync();
var memory = response.BodyPipe.GetMemory(5000);
var memory = response.BodyPipe.GetMemory();
var fisrtPartOfResponse = Encoding.ASCII.GetBytes(new string('a', memory.Length));
fisrtPartOfResponse.CopyTo(memory);
response.BodyPipe.Advance(memory.Length);
@ -2783,7 +2783,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
var memory = response.BodyPipe.GetMemory(0);
Assert.Equal(4096, memory.Length);
memory = response.BodyPipe.GetMemory(1000000);
memory = response.BodyPipe.GetMemory(4096);
Assert.Equal(4096, memory.Length);
});