Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit 238682a

Browse files
committed
Common headers have common offsets
1 parent 82e1218 commit 238682a

File tree

9 files changed

+566
-83
lines changed

9 files changed

+566
-83
lines changed

src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ private bool RequestUrlStartsWithPathBase(string requestUrl, out bool caseMatche
835835

836836
public static bool TakeMessageHeaders(SocketInput input, FrameRequestHeaders requestHeaders)
837837
{
838+
MemoryPoolIterator2 endName;
838839
var scan = input.ConsumingStart();
839840
var consumed = scan;
840841
try
@@ -844,8 +845,15 @@ public static bool TakeMessageHeaders(SocketInput input, FrameRequestHeaders req
844845
while (!scan.IsEnd)
845846
{
846847
var beginName = scan;
847-
scan.Seek(ref _vectorColons, ref _vectorCRs);
848-
var endName = scan;
848+
if (scan.Peek() == '\r' || scan.SeekCommonHeader())
849+
{
850+
endName = scan;
851+
}
852+
else
853+
{
854+
scan.Seek(ref _vectorColons, ref _vectorCRs);
855+
endName = scan;
856+
}
849857

850858
chFirst = scan.Take();
851859
var beginValue = scan;

src/Microsoft.AspNet.Server.Kestrel/Http/FrameHeaders.Generated.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
using System;
33
using System.Collections.Generic;
4-
using System.Text;
54
using Microsoft.AspNet.Server.Kestrel.Infrastructure;
65
using Microsoft.Extensions.Primitives;
76

0 commit comments

Comments
 (0)