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

Commit d0dca75

Browse files
committed
Remove count parameter from ISocketOutput.ProducingComplete
- This makes the calling code cleaner with a (hopefully) minimal pref impact
1 parent dff3a4f commit d0dca75

File tree

9 files changed

+144
-151
lines changed

9 files changed

+144
-151
lines changed

src/Microsoft.AspNet.Server.Kestrel/Filter/StreamSocketOutput.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public MemoryPoolIterator2 ProducingStart()
4242
return new MemoryPoolIterator2(_producingBlock);
4343
}
4444

45-
public void ProducingComplete(MemoryPoolIterator2 end, int count)
45+
public void ProducingComplete(MemoryPoolIterator2 end)
4646
{
4747
var block = _producingBlock;
4848
while (block != end.Block)

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -674,12 +674,12 @@ private Task CreateResponseHeader(
674674
_responseHeaders.SetRawConnection("keep-alive", _bytesConnectionKeepAlive);
675675
}
676676

677-
count += end.CopyFrom(_httpVersion == HttpVersionType.Http1_1 ? _bytesHttpVersion1_1 : _bytesHttpVersion1_0);
678-
count += end.CopyFrom(statusBytes);
679-
count += _responseHeaders.CopyTo(ref end);
680-
count += end.CopyFrom(_bytesEndHeaders, 0, _bytesEndHeaders.Length);
677+
end.CopyFrom(_httpVersion == HttpVersionType.Http1_1 ? _bytesHttpVersion1_1 : _bytesHttpVersion1_0);
678+
end.CopyFrom(statusBytes);
679+
_responseHeaders.CopyTo(ref end);
680+
end.CopyFrom(_bytesEndHeaders, 0, _bytesEndHeaders.Length);
681681

682-
SocketOutput.ProducingComplete(end, count);
682+
SocketOutput.ProducingComplete(end);
683683

684684
if (immediate)
685685
{

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

Lines changed: 66 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -7821,301 +7821,299 @@ protected override void CopyToFast(KeyValuePair<string, StringValues>[] array, i
78217821
((ICollection<KeyValuePair<string, StringValues>>)MaybeUnknown)?.CopyTo(array, arrayIndex);
78227822
}
78237823

7824-
protected int CopyToFast(ref MemoryPoolIterator2 output)
7824+
protected void CopyToFast(ref MemoryPoolIterator2 output)
78257825
{
7826-
var count = 0;
78277826

78287827
if (((_bits & 1L) != 0))
78297828
{
78307829
foreach(var value in _CacheControl)
78317830
{
7832-
count += output.CopyFrom(_headerBytes, 0, 17);
7833-
count += output.CopyFromAscii(value);
7831+
output.CopyFrom(_headerBytes, 0, 17);
7832+
output.CopyFromAscii(value);
78347833
}
78357834
}
78367835

78377836
if (((_bits & 2L) != 0))
78387837
{
78397838
if (_rawConnection != null)
78407839
{
7841-
count += output.CopyFrom(_rawConnection, 0, _rawConnection.Length);
7840+
output.CopyFrom(_rawConnection, 0, _rawConnection.Length);
78427841
} else
78437842
foreach(var value in _Connection)
78447843
{
7845-
count += output.CopyFrom(_headerBytes, 17, 14);
7846-
count += output.CopyFromAscii(value);
7844+
output.CopyFrom(_headerBytes, 17, 14);
7845+
output.CopyFromAscii(value);
78477846
}
78487847
}
78497848

78507849
if (((_bits & 4L) != 0))
78517850
{
78527851
if (_rawDate != null)
78537852
{
7854-
count += output.CopyFrom(_rawDate, 0, _rawDate.Length);
7853+
output.CopyFrom(_rawDate, 0, _rawDate.Length);
78557854
} else
78567855
foreach(var value in _Date)
78577856
{
7858-
count += output.CopyFrom(_headerBytes, 31, 8);
7859-
count += output.CopyFromAscii(value);
7857+
output.CopyFrom(_headerBytes, 31, 8);
7858+
output.CopyFromAscii(value);
78607859
}
78617860
}
78627861

78637862
if (((_bits & 8L) != 0))
78647863
{
78657864
foreach(var value in _KeepAlive)
78667865
{
7867-
count += output.CopyFrom(_headerBytes, 39, 14);
7868-
count += output.CopyFromAscii(value);
7866+
output.CopyFrom(_headerBytes, 39, 14);
7867+
output.CopyFromAscii(value);
78697868
}
78707869
}
78717870

78727871
if (((_bits & 16L) != 0))
78737872
{
78747873
foreach(var value in _Pragma)
78757874
{
7876-
count += output.CopyFrom(_headerBytes, 53, 10);
7877-
count += output.CopyFromAscii(value);
7875+
output.CopyFrom(_headerBytes, 53, 10);
7876+
output.CopyFromAscii(value);
78787877
}
78797878
}
78807879

78817880
if (((_bits & 32L) != 0))
78827881
{
78837882
foreach(var value in _Trailer)
78847883
{
7885-
count += output.CopyFrom(_headerBytes, 63, 11);
7886-
count += output.CopyFromAscii(value);
7884+
output.CopyFrom(_headerBytes, 63, 11);
7885+
output.CopyFromAscii(value);
78877886
}
78887887
}
78897888

78907889
if (((_bits & 64L) != 0))
78917890
{
78927891
if (_rawTransferEncoding != null)
78937892
{
7894-
count += output.CopyFrom(_rawTransferEncoding, 0, _rawTransferEncoding.Length);
7893+
output.CopyFrom(_rawTransferEncoding, 0, _rawTransferEncoding.Length);
78957894
} else
78967895
foreach(var value in _TransferEncoding)
78977896
{
7898-
count += output.CopyFrom(_headerBytes, 74, 21);
7899-
count += output.CopyFromAscii(value);
7897+
output.CopyFrom(_headerBytes, 74, 21);
7898+
output.CopyFromAscii(value);
79007899
}
79017900
}
79027901

79037902
if (((_bits & 128L) != 0))
79047903
{
79057904
foreach(var value in _Upgrade)
79067905
{
7907-
count += output.CopyFrom(_headerBytes, 95, 11);
7908-
count += output.CopyFromAscii(value);
7906+
output.CopyFrom(_headerBytes, 95, 11);
7907+
output.CopyFromAscii(value);
79097908
}
79107909
}
79117910

79127911
if (((_bits & 256L) != 0))
79137912
{
79147913
foreach(var value in _Via)
79157914
{
7916-
count += output.CopyFrom(_headerBytes, 106, 7);
7917-
count += output.CopyFromAscii(value);
7915+
output.CopyFrom(_headerBytes, 106, 7);
7916+
output.CopyFromAscii(value);
79187917
}
79197918
}
79207919

79217920
if (((_bits & 512L) != 0))
79227921
{
79237922
foreach(var value in _Warning)
79247923
{
7925-
count += output.CopyFrom(_headerBytes, 113, 11);
7926-
count += output.CopyFromAscii(value);
7924+
output.CopyFrom(_headerBytes, 113, 11);
7925+
output.CopyFromAscii(value);
79277926
}
79287927
}
79297928

79307929
if (((_bits & 1024L) != 0))
79317930
{
79327931
foreach(var value in _Allow)
79337932
{
7934-
count += output.CopyFrom(_headerBytes, 124, 9);
7935-
count += output.CopyFromAscii(value);
7933+
output.CopyFrom(_headerBytes, 124, 9);
7934+
output.CopyFromAscii(value);
79367935
}
79377936
}
79387937

79397938
if (((_bits & 2048L) != 0))
79407939
{
79417940
if (_rawContentLength != null)
79427941
{
7943-
count += output.CopyFrom(_rawContentLength, 0, _rawContentLength.Length);
7942+
output.CopyFrom(_rawContentLength, 0, _rawContentLength.Length);
79447943
} else
79457944
foreach(var value in _ContentLength)
79467945
{
7947-
count += output.CopyFrom(_headerBytes, 133, 18);
7948-
count += output.CopyFromAscii(value);
7946+
output.CopyFrom(_headerBytes, 133, 18);
7947+
output.CopyFromAscii(value);
79497948
}
79507949
}
79517950

79527951
if (((_bits & 4096L) != 0))
79537952
{
79547953
foreach(var value in _ContentType)
79557954
{
7956-
count += output.CopyFrom(_headerBytes, 151, 16);
7957-
count += output.CopyFromAscii(value);
7955+
output.CopyFrom(_headerBytes, 151, 16);
7956+
output.CopyFromAscii(value);
79587957
}
79597958
}
79607959

79617960
if (((_bits & 8192L) != 0))
79627961
{
79637962
foreach(var value in _ContentEncoding)
79647963
{
7965-
count += output.CopyFrom(_headerBytes, 167, 20);
7966-
count += output.CopyFromAscii(value);
7964+
output.CopyFrom(_headerBytes, 167, 20);
7965+
output.CopyFromAscii(value);
79677966
}
79687967
}
79697968

79707969
if (((_bits & 16384L) != 0))
79717970
{
79727971
foreach(var value in _ContentLanguage)
79737972
{
7974-
count += output.CopyFrom(_headerBytes, 187, 20);
7975-
count += output.CopyFromAscii(value);
7973+
output.CopyFrom(_headerBytes, 187, 20);
7974+
output.CopyFromAscii(value);
79767975
}
79777976
}
79787977

79797978
if (((_bits & 32768L) != 0))
79807979
{
79817980
foreach(var value in _ContentLocation)
79827981
{
7983-
count += output.CopyFrom(_headerBytes, 207, 20);
7984-
count += output.CopyFromAscii(value);
7982+
output.CopyFrom(_headerBytes, 207, 20);
7983+
output.CopyFromAscii(value);
79857984
}
79867985
}
79877986

79887987
if (((_bits & 65536L) != 0))
79897988
{
79907989
foreach(var value in _ContentMD5)
79917990
{
7992-
count += output.CopyFrom(_headerBytes, 227, 15);
7993-
count += output.CopyFromAscii(value);
7991+
output.CopyFrom(_headerBytes, 227, 15);
7992+
output.CopyFromAscii(value);
79947993
}
79957994
}
79967995

79977996
if (((_bits & 131072L) != 0))
79987997
{
79997998
foreach(var value in _ContentRange)
80007999
{
8001-
count += output.CopyFrom(_headerBytes, 242, 17);
8002-
count += output.CopyFromAscii(value);
8000+
output.CopyFrom(_headerBytes, 242, 17);
8001+
output.CopyFromAscii(value);
80038002
}
80048003
}
80058004

80068005
if (((_bits & 262144L) != 0))
80078006
{
80088007
foreach(var value in _Expires)
80098008
{
8010-
count += output.CopyFrom(_headerBytes, 259, 11);
8011-
count += output.CopyFromAscii(value);
8009+
output.CopyFrom(_headerBytes, 259, 11);
8010+
output.CopyFromAscii(value);
80128011
}
80138012
}
80148013

80158014
if (((_bits & 524288L) != 0))
80168015
{
80178016
foreach(var value in _LastModified)
80188017
{
8019-
count += output.CopyFrom(_headerBytes, 270, 17);
8020-
count += output.CopyFromAscii(value);
8018+
output.CopyFrom(_headerBytes, 270, 17);
8019+
output.CopyFromAscii(value);
80218020
}
80228021
}
80238022

80248023
if (((_bits & 1048576L) != 0))
80258024
{
80268025
foreach(var value in _AcceptRanges)
80278026
{
8028-
count += output.CopyFrom(_headerBytes, 287, 17);
8029-
count += output.CopyFromAscii(value);
8027+
output.CopyFrom(_headerBytes, 287, 17);
8028+
output.CopyFromAscii(value);
80308029
}
80318030
}
80328031

80338032
if (((_bits & 2097152L) != 0))
80348033
{
80358034
foreach(var value in _Age)
80368035
{
8037-
count += output.CopyFrom(_headerBytes, 304, 7);
8038-
count += output.CopyFromAscii(value);
8036+
output.CopyFrom(_headerBytes, 304, 7);
8037+
output.CopyFromAscii(value);
80398038
}
80408039
}
80418040

80428041
if (((_bits & 4194304L) != 0))
80438042
{
80448043
foreach(var value in _ETag)
80458044
{
8046-
count += output.CopyFrom(_headerBytes, 311, 8);
8047-
count += output.CopyFromAscii(value);
8045+
output.CopyFrom(_headerBytes, 311, 8);
8046+
output.CopyFromAscii(value);
80488047
}
80498048
}
80508049

80518050
if (((_bits & 8388608L) != 0))
80528051
{
80538052
foreach(var value in _Location)
80548053
{
8055-
count += output.CopyFrom(_headerBytes, 319, 12);
8056-
count += output.CopyFromAscii(value);
8054+
output.CopyFrom(_headerBytes, 319, 12);
8055+
output.CopyFromAscii(value);
80578056
}
80588057
}
80598058

80608059
if (((_bits & 16777216L) != 0))
80618060
{
80628061
foreach(var value in _ProxyAutheticate)
80638062
{
8064-
count += output.CopyFrom(_headerBytes, 331, 21);
8065-
count += output.CopyFromAscii(value);
8063+
output.CopyFrom(_headerBytes, 331, 21);
8064+
output.CopyFromAscii(value);
80668065
}
80678066
}
80688067

80698068
if (((_bits & 33554432L) != 0))
80708069
{
80718070
foreach(var value in _RetryAfter)
80728071
{
8073-
count += output.CopyFrom(_headerBytes, 352, 15);
8074-
count += output.CopyFromAscii(value);
8072+
output.CopyFrom(_headerBytes, 352, 15);
8073+
output.CopyFromAscii(value);
80758074
}
80768075
}
80778076

80788077
if (((_bits & 67108864L) != 0))
80798078
{
80808079
if (_rawServer != null)
80818080
{
8082-
count += output.CopyFrom(_rawServer, 0, _rawServer.Length);
8081+
output.CopyFrom(_rawServer, 0, _rawServer.Length);
80838082
} else
80848083
foreach(var value in _Server)
80858084
{
8086-
count += output.CopyFrom(_headerBytes, 367, 10);
8087-
count += output.CopyFromAscii(value);
8085+
output.CopyFrom(_headerBytes, 367, 10);
8086+
output.CopyFromAscii(value);
80888087
}
80898088
}
80908089

80918090
if (((_bits & 134217728L) != 0))
80928091
{
80938092
foreach(var value in _SetCookie)
80948093
{
8095-
count += output.CopyFrom(_headerBytes, 377, 14);
8096-
count += output.CopyFromAscii(value);
8094+
output.CopyFrom(_headerBytes, 377, 14);
8095+
output.CopyFromAscii(value);
80978096
}
80988097
}
80998098

81008099
if (((_bits & 268435456L) != 0))
81018100
{
81028101
foreach(var value in _Vary)
81038102
{
8104-
count += output.CopyFrom(_headerBytes, 391, 8);
8105-
count += output.CopyFromAscii(value);
8103+
output.CopyFrom(_headerBytes, 391, 8);
8104+
output.CopyFromAscii(value);
81068105
}
81078106
}
81088107

81098108
if (((_bits & 536870912L) != 0))
81108109
{
81118110
foreach(var value in _WWWAuthenticate)
81128111
{
8113-
count += output.CopyFrom(_headerBytes, 399, 20);
8114-
count += output.CopyFromAscii(value);
8112+
output.CopyFrom(_headerBytes, 399, 20);
8113+
output.CopyFromAscii(value);
81158114
}
81168115
}
81178116

8118-
return count;
81198117
}
81208118
public unsafe void Append(byte[] keyBytes, int keyOffset, int keyLength, string value)
81218119
{

0 commit comments

Comments
 (0)