hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: svn commit: r573978
Date Sun, 09 Sep 2007 11:02:52 GMT
On Sun, 2007-09-09 at 10:15 +0000, rolandw@apache.org wrote:
> Author: rolandw
> Date: Sun Sep  9 03:15:39 2007
> New Revision: 573978
> 
> URL: http://svn.apache.org/viewvc?rev=573978&view=rev
> Log:
> HTTPCORE-107: BasicLineParser uses configurable protocol name
> 

...

> +        final String protoname = this.protocol.getProtocol();
> +        final int protolength  = protoname.length();
> +
> +        int i = skipWhitespace(buffer, indexFrom);
> +        // long enough for "HTTP/1.1"?
> +        if (i + protolength + 4 > indexTo) {
> +            throw new ParseException
> +                ("Not a valid protocol version: " +
> +                 buffer.substring(indexFrom, indexTo));
> +        }
> +

Roland,

If you want the parser to be truly generic you cannot expect the version
part to always be 4 char in length as it can also be something like
20.121 or 234.5

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Mime
View raw message