예제 #1
0
        void Init()
        {
            if (ssl_stream != null)
            {
                //ssl_stream.AuthenticateAsServer(client_cert, true, (SslProtocols)ServicePointManager.SecurityProtocol, false);
            }

            context_bound = false;
            i_stream      = null;
            o_stream      = null;
            prefix        = null;
            chunked       = false;
            ms            = new MemoryStream();
            position      = 0;
            input_state   = InputState.RequestLine;
            line_state    = LineState.None;
            context       = new HttpListenerContext(this, _logger);
        }
예제 #2
0
        void Init()
        {
            if (ssl_stream != null)
            {
                //ssl_stream.AuthenticateAsServer(client_cert, true, (SslProtocols)ServicePointManager.SecurityProtocol, false);
                //_streamFactory.AuthenticateSslStreamAsServer(ssl_stream, cert);
            }

            context_bound = false;
            i_stream      = null;
            o_stream      = null;
            prefix        = null;
            chunked       = false;
            ms            = _memoryStreamFactory.CreateNew();
            position      = 0;
            input_state   = InputState.RequestLine;
            line_state    = LineState.None;
            context       = new HttpListenerContext(this, _logger, _cryptoProvider, _memoryStreamFactory, _textEncoding);
        }
예제 #3
0
 public RequestStream GetRequestStream(bool chunked, long contentlength)
 {
     if (i_stream == null)
     {
         byte[] buffer = ms.GetBuffer();
         int    length = (int)ms.Length;
         ms = null;
         if (chunked)
         {
             this.chunked = true;
             context.Response.SendChunked = true;
             i_stream = new ChunkedInputStream(context, stream, buffer, position, length - position);
         }
         else
         {
             i_stream = new RequestStream(stream, buffer, position, length - position, contentlength);
         }
     }
     return(i_stream);
 }