SocketInputStream extends java.io.BufferedInputStream and uses the 
protected fields buf, pos and count.

As far as I can see there are several problems with some uses of pos:
First of all the use of buf and pos are not defined by the api, so it is 
theoretical implementation dependent.

Furthermore there are some problems even if the buf and pos are used in 
the original way:

For example if in line 257:           
           requestLine.uri[readCount] = (char) buf[pos];
           readCount++;
           pos++;

buf[pos] is undefined the last fill called by the last read() only got 
one byte (which was enough for the last read()).

There are several situations in the class where this problem could happen.

I think this class should be rewritten using PushbackInputStream (or 
better using a new PushbackInputStream(new BufferInputStream(in))).

I would volunteer rewriting this class if you agree with my assumptions.



-- 
Thomas Butter <[EMAIL PROTECTED]>  ICQ: 891617

"Unix IS user friendly, it is just selective about who his friends are."


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to