void processConnection(MsgContext ep) { try { MsgAjp recv=new MsgAjp(); while( running ) { int status= this.receive( recv, ep );
i looked into these sources, and i am shocked!!!
this.receive() uses this.read(), and this method finally calls the InputStream.read(). as everybody should know, InputStrean.read() returns -1 if the end of the inputstream is reached.
this case is checked, but instead of doing something useful, the case is not really handled.
It's handled, the connection is closed.
i suggest throwing an EOSException (EOS=EndOfStream) which is derived from IOException.
as this.read() is supposed to read exactly len bytes, it should only throw the EOSException, if the first call of InputStream.read() in the loop returns -1.
I'd prefer avoid generation too many exceptions in real-time environnement. After all if read return something < 0, the loop
is exited and the connection closed in the finally block.
FYI, Apache close ajp13 connections each time it recycle/kill a child and under heavy load on webserver, it happen very often.
If the webserver has closed a connection, tomcat detect it has close the connection silently....
This exception can be catched down below, to more gracefully handle a connection-close.
BTW: there's also a comment that this improvement should be in AJP14. This has nothing to do with AJP14 (which is a protocol) but it's just bad programmed.
May be.
Usually I'd rather like see patches instead of coding style critics. You're welcome to provide us your solution.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]