This commit is contained in:
@@ -64,6 +64,7 @@ public final class PrepareRunner implements Runnable {
|
|||||||
try {
|
try {
|
||||||
response.request.offerReadBuffer(buffer);
|
response.request.offerReadBuffer(buffer);
|
||||||
response.finish(true);
|
response.finish(true);
|
||||||
|
channel.close();// response.init(channel); 在调用之前异常
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (context.logger.isLoggable(Level.FINEST)) {
|
if (context.logger.isLoggable(Level.FINEST)) {
|
||||||
context.logger.log(Level.FINEST, "PrepareRunner close channel erroneous on no read bytes", e);
|
context.logger.log(Level.FINEST, "PrepareRunner close channel erroneous on no read bytes", e);
|
||||||
@@ -91,6 +92,10 @@ public final class PrepareRunner implements Runnable {
|
|||||||
public void failed(Throwable exc, Void attachment2) {
|
public void failed(Throwable exc, Void attachment2) {
|
||||||
response.request.offerReadBuffer(buffer);
|
response.request.offerReadBuffer(buffer);
|
||||||
response.finish(true);
|
response.finish(true);
|
||||||
|
try { // response.init(channel); 可能在调用之前异常
|
||||||
|
channel.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
if (exc != null && context.logger.isLoggable(Level.FINEST)) {
|
if (exc != null && context.logger.isLoggable(Level.FINEST)) {
|
||||||
context.logger.log(Level.FINEST, "Servlet Handler read channel erroneous, forece to close channel ", exc);
|
context.logger.log(Level.FINEST, "Servlet Handler read channel erroneous, forece to close channel ", exc);
|
||||||
}
|
}
|
||||||
@@ -99,6 +104,10 @@ public final class PrepareRunner implements Runnable {
|
|||||||
} catch (Exception te) {
|
} catch (Exception te) {
|
||||||
response.request.offerReadBuffer(buffer);
|
response.request.offerReadBuffer(buffer);
|
||||||
response.finish(true);
|
response.finish(true);
|
||||||
|
try { // response.init(channel); 可能在调用之前异常
|
||||||
|
channel.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
if (te != null && context.logger.isLoggable(Level.FINEST)) {
|
if (te != null && context.logger.isLoggable(Level.FINEST)) {
|
||||||
context.logger.log(Level.FINEST, "Servlet read channel erroneous, forece to close channel ", te);
|
context.logger.log(Level.FINEST, "Servlet read channel erroneous, forece to close channel ", te);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,9 +184,7 @@ public abstract class Response<C extends Context, R extends Request<C>> {
|
|||||||
request.recycle();
|
request.recycle();
|
||||||
if (channel != null) {
|
if (channel != null) {
|
||||||
if (keepAlive) {
|
if (keepAlive) {
|
||||||
this.inited = false;
|
this.context.runAsync(new PrepareRunner(context, channel, null, null));
|
||||||
new PrepareRunner(context, removeChannel(), null, this).run();
|
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
if (channel.isOpen()) channel.close();
|
if (channel.isOpen()) channel.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user