Author: markt
Date: Wed Apr 24 19:52:25 2013
New Revision: 1471614
URL: http://svn.apache.org/r1471614
Log: (empty)
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties?rev=1471614&r1=1471613&r2=1471614&view=diff
==============================================================================
---
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
(original)
+++
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
Wed Apr 24 19:52:25 2013
@@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-apr.error=Unexpected error [{0}] reading data from the APR/native socket.
+apr.read.error=Error [{0}] reading data from the APR/native socket.
+apr.write.error=Error [{0}] writing data to the APR/native socket.
nio.eof.error=Unexpected EOF read on the socket
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java?rev=1471614&r1=1471613&r2=1471614&view=diff
==============================================================================
---
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java
(original)
+++
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java
Wed Apr 24 19:52:25 2013
@@ -49,13 +49,21 @@ public class UpgradeAprProcessor extends
@Override
public void write(int b) throws IOException {
- Socket.send(socket, new byte[] {(byte) b}, 0, 1);
+ int result = Socket.send(socket, new byte[] {(byte) b}, 0, 1);
+ if (result != 1) {
+ throw new IOException(sm.getString("apr.write.error",
+ Integer.valueOf(-result)));
+ }
}
@Override
public void write(byte[]b, int off, int len) throws IOException {
- Socket.send(socket, b, off, len);
+ int result = Socket.send(socket, b, off, len);
+ if (result != len) {
+ throw new IOException(sm.getString("apr.write.error",
+ Integer.valueOf(-result)));
+ }
}
@@ -87,7 +95,7 @@ public class UpgradeAprProcessor extends
} else if (-result == Status.EAGAIN) {
return 0;
} else {
- throw new IOException(sm.getString("apr.error",
+ throw new IOException(sm.getString("apr.read.error",
Integer.valueOf(-result)));
}
} finally {
Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1471614&r1=1471613&r2=1471614&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Apr 24 19:52:25 2013
@@ -74,6 +74,15 @@
</fix>
</changelog>
</subsection>
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ Ensure write errors when using HTTP Upgrade with the APR/native
+ connector result in <code>IOException</code>s rather than errors being
+ silently swallowed. (markt)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Jasper">
<changelog>
<fix>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]