private bool isRequestComplete() { if (this.m_headers == null) { if (!this.HeadersAvailable()) { return(false); } if (!this.ParseRequestForHeaders()) { string str; if (this.m_requestData != null) { str = Utilities.ByteArrayToHexView(this.m_requestData.GetBuffer(), 0x18, (int)Math.Min(this.m_requestData.Length, 0x800L)); } else { str = "{Web Browser:no data}"; } if (this.m_headers == null) { this.m_headers = new HTTPRequestHeaders(); this.m_headers.HTTPMethod = "BAD"; this.m_headers["Host"] = "BAD-REQUEST"; this.m_headers.RequestPath = "/BAD_REQUEST"; } this.FailSession(400, "Web Browser - Bad Request", "[Web Browser] Request Header parsing failed. Request was:\n" + str); return(true); } this.m_session.Timers.SDVPGotRequestHeaders = DateTime.Now; this.m_session._AssignID(); SDVPApplication.DoRequestHeadersAvailable(this.m_session); } if (this.m_headers.ExistsAndEquals("Transfer-encoding", "chunked")) { long num; long num2; return(Utilities.IsChunkedBodyComplete(this.m_session, this.m_requestData, (long)this.iEntityBodyOffset, out num2, out num)); } if (this.m_headers.Exists("Content-Length")) { long result = 0L; try { if (!long.TryParse(this.m_headers["Content-Length"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out result) || (result < 0L)) { SDVPApplication.HandleHTTPError(this.m_session, SessionFlags.ProtocolViolationInRequest, true, true, "Request content length was invalid.\nContent-Length: " + this.m_headers["Content-Length"]); this.FailSession(400, "Web Browser - Bad Request", "[Web Browser] Request Content-Length header parsing failed.\nContent-Length: " + this.m_headers["Content-Length"]); return(true); } return(this.m_requestData.Length >= (this.iEntityBodyOffset + result)); } catch { this.FailSession(400, "Web Browser - Bad Request", "[Web Browser] Unknown error: Check content length header?"); return(false); } } return(true); }