2011/7/19  <jfcl...@apache.org>:
> Author: jfclere
> Date: Tue Jul 19 08:06:46 2011
> New Revision: 1148216
>
> URL: http://svn.apache.org/viewvc?rev=1148216&view=rev
> Log:
> Fix for PR49595
>
> Modified:
>    tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
>

> --- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original)
> +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Tue Jul 19 
> 08:06:46 2011
> @@ -507,13 +507,13 @@ public class AjpAprProcessor extends Abs
>         long socketRef = socket.getSocket().longValue();
>
>         if (outputBuffer.position() > 0) {
> -            if (Socket.sendbb(socketRef, 0, outputBuffer.position()) < 0) {
> +            if ((socketRef != 0) && Socket.sendbb(socketRef, 0, 
> outputBuffer.position()) < 0) {
>                 throw new 
> IOException(sm.getString("ajpprocessor.failedsend"));
>             }
>             outputBuffer.clear();

1. Shouldn't socketRef eq 0 result in IOException as well here and in
the fragment below?
2. I suspect that outputBuffer.clear() should be called even if
IOException is thrown.

>         }
>         // Send explicit flush message
> -        if (explicit && !finished) {
> +        if (explicit && !finished &&  (socketRef != 0)) {
>             if (Socket.send(socketRef, flushMessageArray, 0,
>                     flushMessageArray.length) < 0) {
>                 throw new 
> IOException(sm.getString("ajpprocessor.failedflush"));
>
>
>
> ---------------------------------------------------------------------


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to