Pre-create Continue bytes in Frame
This commit is contained in:
parent
0670b7ae61
commit
98995132de
|
|
@ -260,7 +260,13 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
||||||
//_upgradeTask = callback(_callContext);
|
//_upgradeTask = callback(_callContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] _continueBytes = Encoding.ASCII.GetBytes("HTTP/1.1 100 Continue\r\n\r\n");
|
private static readonly ArraySegment<byte> _continueBytes = CreateAsciiByteArraySegment("HTTP/1.1 100 Continue\r\n\r\n");
|
||||||
|
|
||||||
|
private static ArraySegment<byte> CreateAsciiByteArraySegment(string text)
|
||||||
|
{
|
||||||
|
var bytes = Encoding.ASCII.GetBytes(text);
|
||||||
|
return new ArraySegment<byte>(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
public void ProduceContinue()
|
public void ProduceContinue()
|
||||||
{
|
{
|
||||||
|
|
@ -272,7 +278,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
||||||
(expect.FirstOrDefault() ?? "").Equals("100-continue", StringComparison.OrdinalIgnoreCase))
|
(expect.FirstOrDefault() ?? "").Equals("100-continue", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
SocketOutput.Write(
|
SocketOutput.Write(
|
||||||
new ArraySegment<byte>(_continueBytes, 0, _continueBytes.Length),
|
_continueBytes,
|
||||||
(error, _) =>
|
(error, _) =>
|
||||||
{
|
{
|
||||||
if (error != null)
|
if (error != null)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue