Author: remy.maucherat(a)jboss.com
Date: 2010-03-04 08:30:39 -0500 (Thu, 04 Mar 2010)
New Revision: 1394
Modified:
trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
Log:
- Add a condition on a write block since the write is not certain, leading to setting last
write back to 0.
Modified: trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2010-03-04 13:29:39
UTC (rev 1393)
+++ trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2010-03-04 13:30:39
UTC (rev 1394)
@@ -748,19 +748,21 @@
int pos = 0;
int end = bbuf.position();
- int res = 0;
- while (pos < end) {
- res = Socket.sendibb(socket, pos, end - pos);
- if (res > 0) {
- pos += res;
- } else {
- break;
+ if (pos < end) {
+ int res = 0;
+ while (pos < end) {
+ res = Socket.sendibb(socket, pos, end - pos);
+ if (res > 0) {
+ pos += res;
+ } else {
+ break;
+ }
}
+ if (res < 0) {
+ throw new IOException(sm.getString("oob.failedwrite"));
+ }
+ response.setLastWrite(res);
}
- if (res < 0) {
- throw new IOException(sm.getString("oob.failedwrite"));
- }
- response.setLastWrite(res);
if (pos < end) {
leftover.allocate(end - pos, -1);
bbuf.position(pos);
Show replies by date