[2.2.1] Use non-pinnable buffer for zero byte read (#4066)
This commit is contained in:
parent
20f7d3be9d
commit
f7c26f9912
|
|
@ -15,7 +15,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal
|
|||
|
||||
public SocketAwaitableEventArgs WaitForDataAsync()
|
||||
{
|
||||
#if NETCOREAPP2_1
|
||||
_awaitableEventArgs.SetBuffer(Memory<byte>.Empty);
|
||||
#elif NETSTANDARD2_0
|
||||
_awaitableEventArgs.SetBuffer(Array.Empty<byte>(), 0, 0);
|
||||
#else
|
||||
#error TFMs need to be updated
|
||||
#endif
|
||||
|
||||
if (!_socket.ReceiveAsync(_awaitableEventArgs))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue