This commit is contained in:
Redkale
2018-05-30 18:54:02 +08:00
parent ae8fb992fb
commit 7b5b0f34ff

View File

@@ -251,11 +251,15 @@ public abstract class Response<C extends Context, R extends Request<C>> {
} }
this.recycleListener = null; this.recycleListener = null;
} }
if (request.keepAlive && channel != null && channel.isOpen()) { if (request.keepAlive && channel != null) {
AsyncConnection conn = removeChannel(); if (channel.isOpen()) {
this.recycle(); AsyncConnection conn = removeChannel();
this.prepare(); this.recycle();
new PrepareRunner(context, conn, null, this).run(); this.prepare();
new PrepareRunner(context, conn, null, this).run();
} else {
channel.dispose();
}
} else { } else {
this.context.responsePool.accept(this); this.context.responsePool.accept(this);
} }