Ejemplo n.º 1
0
 private void clearStatus()
 {
     ClearCaches();
     outputStream = null; outputWriter = null; inputDataStream = null;
     RawRequest   = Host = Method = Url = Url_path = Url_qstr = HttpVersion = RealUrl = RealPath = RealPathEscaped = null;
     RequestHeaders?.Clear();
     ResponseHeaders?.Clear();
     ResponseStatusCode = defaultResponseCode;
 }
Ejemplo n.º 2
0
 private void initInputDataStream()
 {
     inputDataStream = null;
     if (RequestHeaders[KEY_Content_Length] is string lengthHeader)
     {
         long length = 0;
         if (long.TryParse(lengthHeader, out length) && length >= 0)
         {
             inputDataStream = new InputDataStream(this, length);
         }
         else
         {
             throw new Exception("Bad Content-Length.");
         }
     }
     else if (RequestHeaders[KEY_Transfer_Encoding] as string == VALUE_Transfer_Encoding_chunked)
     {
         inputDataStream = new InputDataStream(this);
     }
 }