Skip to content

Commit

Permalink
Fixup pRequestInfo after GCs (#50448)
Browse files Browse the repository at this point in the history
  • Loading branch information
NGloreous authored Sep 1, 2023
1 parent ce6a7d2 commit 0a51ea1
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 @@ -555,9 +555,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 offset = (long)requestInfo.pInfo - (long)baseAddress;
info.Add(
(int)requestInfo.InfoType,
Expand Down

0 comments on commit 0a51ea1

Please sign in to comment.