public void CopyFrom(HttpSocketContext other)
{
RequestHeadersLength = other.RequestHeadersLength;
ResponseHeadersLength = 0;
if (RequestHeaders.Length < RequestHeadersLength)
{
var newHeaders = new HeaderPair[other.RequestHeaders.Length];
Array.Copy(other.RequestHeaders, newHeaders, RequestHeadersLength);
RequestHeaders = newHeaders;
}
else Array.Copy(other.RequestHeaders, RequestHeaders, RequestHeadersLength);
RawUrl = other.RawUrl;
positionInTmp = other.positionInTmp;
Pipeline = other.Pipeline;
IsHttp10 = other.IsHttp10;
totalBytes = other.totalBytes;
Buffer.BlockCopy(other.InputTemp, 0, InputTemp, 0, positionInTmp);
other.InputStream.CopyTo(InputStream);
InputStream.Position = other.InputStream.Position;
InputStream.SetLength(other.InputStream.Length);
HttpMethod = other.HttpMethod;
HttpProtocolVersion = other.HttpProtocolVersion;
TemplateMatch = other.TemplateMatch;
ResponseStatus = HttpStatusCode.OK;
ResponseLength = null;
ResponseContentType = null;
ResponseIsJson = false;
ContentTypeResponseIndex = -1;
offsetInOutput = 0;
}