Ejemplo n.º 1
0
 private void ParseReasonPhrase()
 {
     sb.Clear();
     while (c != -1 && !HttpChar.IsControl(c))
     {
         sb.Append((char)c);
         c = TextStore.ReadChar();
     }
     StatusLine.ReasonPhrase = sb.ToString();
 }
Ejemplo n.º 2
0
 protected bool ParseText()
 {
     if (ParseLinearWhiteSpace())
     {
         return(true);
     }
     else if (HttpChar.IsControl(c))
     {
         return(false);
     }
     else
     {
         sb.Append((char)c);
         c = TextStore.ReadChar();
         return(true);
     }
 }
Ejemplo n.º 3
0
 protected bool ParseHexNumber()
 {
     if (HttpChar.IsHexDigit(c))
     {
         sb.Clear();
         sb.Append((char)c);
         c = TextStore.ReadChar();
     }
     else
     {
         return(false);
     }
     while (HttpChar.IsHexDigit(c))
     {
         sb.Append((char)c);
         c = TextStore.ReadChar();
     }
     return(true);
 }
Ejemplo n.º 4
0
 protected bool ParseString()
 {
     if (HttpChar.IsChar(c) && !HttpChar.IsControl(c) && c != HttpChar.SP)
     {
         sb.Clear();
         sb.Append((char)c);
         c = TextStore.ReadChar();
     }
     else
     {
         return(false);
     }
     while (HttpChar.IsChar(c) && !HttpChar.IsControl(c) && c != HttpChar.SP)
     {
         sb.Append((char)c);
         c = TextStore.ReadChar();
     }
     return(true);
 }
Ejemplo n.º 5
0
 protected bool ParseToken()
 {
     if (HttpChar.IsChar(c) && !HttpChar.IsControl(c) && !HttpChar.IsSeparator(c))
     {
         sb.Clear();
         sb.Append((char)c);
         c = TextStore.ReadChar();
     }
     else
     {
         return(false);
     }
     while (HttpChar.IsChar(c) && !HttpChar.IsControl(c) && !HttpChar.IsSeparator(c))
     {
         sb.Append((char)c);
         c = TextStore.ReadChar();
     }
     return(true);
 }
Ejemplo n.º 6
0
 protected bool ParseQuotedPair()
 {
     if (c == '\\')
     {
         c = TextStore.ReadChar();
     }
     else
     {
         return(false);
     }
     if (HttpChar.IsChar(c))
     {
         sb.Append('\\');
         sb.Append((char)c);
         c = TextStore.ReadChar();
         return(true);
     }
     else
     {
         throw new Exception(ERROR_MALFORMED_QUOTEDPAIR);
     }
 }