void ParseContentBody() { if (!pendingHead) { if (currentMessage.ContentLength > 0) { long lenghtToRead = streamInner.Length - streamInner.Position; if (lenghtToRead > 0) { if (currentMessage.Body == null) { currentMessage.CreateBody(); } long pendingToRead = currentMessage.ContentLength - currentMessage.Body.Length; if (lenghtToRead > pendingToRead) { lenghtToRead = pendingToRead; } long oldLength = currentMessage.Body.Length; Streams.CopyToEnd(streamInner, currentMessage.Body, lenghtToRead); currentRead += lenghtToRead; if (currentMessage.Body.Length >= currentMessage.ContentLength) { if (currentMessage.TransferEncoding == TransferEncodings.CHUNKED) { pendingChunkedContentSize = true; } else { ResetPendingComplete(); } } if (currentMessage.IsCompleted && currentMessage.ContentType == HttpConst.FormUrlEncoded) { currentMessage.Form = HttpUtility.ParseQueryString(currentMessage.Body.GetPlainText(), currentMessage.ContentTransferEncoding); } } } else if (currentMessage.TransferEncoding != TransferEncodings.CHUNKED) { currentMessage.IsCompleted = true; firstField = true; pendingHead = true; } } }