Improve handling of exceptions when flushing the response buffer to ensure that the doFlush flag does not get stuck in the enabled state.
Patch provided by Jeremy Norris.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@
1133014 13f79535-47bb-0310-9956-
ffa450edef68
bb.recycle();
closed = false;
+ doFlush = false;
suspended = false;
if (conv!= null) {
if (suspended)
return;
- doFlush = true;
- if (initial) {
- coyoteResponse.sendHeaders();
- initial = false;
- }
- if (bb.getLength() > 0) {
- bb.flushBuffer();
+ try {
+ doFlush = true;
+ if (initial) {
+ coyoteResponse.sendHeaders();
+ initial = false;
+ }
+ if (bb.getLength() > 0) {
+ bb.flushBuffer();
+ }
+ } finally {
+ doFlush = false;
}
- doFlush = false;
if (realFlush) {
coyoteResponse.action(ActionCode.CLIENT_FLUSH,
Other
-->
<section name="Tomcat 7.0.16 (markt)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ <bug>51324</bug>: Improve handling of exceptions when flushing the
+ response buffer to ensure that the doFlush flag does not get stuck in
+ the enabled state. Patch provided by Jeremy Norris. (markt)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Coyote">
<changelog>
<fix>