Пример #1
0
 private void init()
 {
     this._chunked       = false;
     this._context       = new HttpListenerContext(this);
     this._inputState    = HttpConnection.InputState.RequestLine;
     this._inputStream   = null;
     this._lineState     = HttpConnection.LineState.None;
     this._outputStream  = null;
     this._position      = 0;
     this._prefix        = null;
     this._requestBuffer = new MemoryStream();
 }
Пример #2
0
 private void Init()
 {
     this.context_bound = false;
     this.i_stream      = null;
     this.o_stream      = null;
     this.prefix        = null;
     this.chunked       = false;
     this.ms            = new MemoryStream();
     this.position      = 0;
     this.input_state   = HttpConnection.InputState.RequestLine;
     this.line_state    = HttpConnection.LineState.None;
     this.context       = new HttpListenerContext(this);
 }
Пример #3
0
        private string readLine(byte[] buffer, int offset, int length, ref int used)
        {
            if (this._currentLine == null)
            {
                this._currentLine = new StringBuilder();
            }
            int num = offset + length;

            used = 0;
            int num2 = offset;

            while (num2 < num && this._lineState != HttpConnection.LineState.LF)
            {
                used++;
                byte b = buffer[num2];
                if (b == 13)
                {
                    this._lineState = HttpConnection.LineState.CR;
                }
                else if (b == 10)
                {
                    this._lineState = HttpConnection.LineState.LF;
                }
                else
                {
                    this._currentLine.Append((char)b);
                }
                num2++;
            }
            string result = null;

            if (this._lineState == HttpConnection.LineState.LF)
            {
                this._lineState          = HttpConnection.LineState.None;
                result                   = this._currentLine.ToString();
                this._currentLine.Length = 0;
            }
            return(result);
        }