https://bz.apache.org/bugzilla/show_bug.cgi?id=60372
--- Comment #5 from Evgenij Ryazanov <kat...@gmail.com> ---
Oh, I see. But exception in the middle of commit() method can prevent proper
reinitialization.

@@ -347,6 +347,8 @@
         if (headerBuffer.position() > 0) {
             // Sending the response header buffer
             headerBuffer.flip();
+            // Random I/O exception
+            if (Math.random() < 0.1)
+                throw new IOException();
             socketWrapper.write(isBlocking(), headerBuffer);
             headerBuffer.position(0).limit(headerBuffer.capacity());
         }
@@ -493,6 +495,8 @@
      * requested number of bytes.
      */
     private void checkLengthBeforeWrite(int length) {
+        if (headerBuffer.capacity() != headerBuffer.limit())
+            System.err.printf("%d != %d%n", headerBuffer.capacity(),
headerBuffer.limit());
         // "+ 4": BZ 57509. Reserve space for CR/LF/COLON/SP characters that
         // are put directly into the buffer following this write operation.
         if (headerBuffer.position() + length + 4 > headerBuffer.capacity()) {

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to