Skip to content

Commit

Permalink
Fixup pRequestInfo after GCs (#50446)
Browse files Browse the repository at this point in the history
  • Loading branch information
NGloreous authored Aug 31, 2023
1 parent a42669b commit 405577a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Shared/HttpSys/RequestProcessing/NativeRequestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,12 @@ private IReadOnlyDictionary<int, ReadOnlyMemory<byte>> GetRequestInfo(IntPtr bas

var info = new Dictionary<int, ReadOnlyMemory<byte>>(count);

long fixup = (byte*)nativeRequest - (byte*)baseAddress;
var pRequestInfo = (HttpApiTypes.HTTP_REQUEST_INFO*)((byte*)nativeRequest->pRequestInfo + fixup);

for (var i = 0; i < count; i++)
{
var requestInfo = nativeRequest->pRequestInfo[i];
var requestInfo = pRequestInfo[i];

var memory = PermanentlyPinned
? new PointerMemoryManager<byte>((byte*)requestInfo.pInfo, (int)requestInfo.InfoLength).Memory
Expand Down

0 comments on commit 405577a

Please sign in to comment.