tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r1148216 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
Date Thu, 21 Jul 2011 11:34:53 GMT
2011/7/19  <jfclere@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message