*/
public void outputReady(final NHttpServerConnection conn, final ContentEncoder encoder) {
HttpContext context = conn.getContext();
HttpResponse response = conn.getHttpResponse();
ContentOutputBuffer outBuf = (ContentOutputBuffer) context.getAttribute(
RESPONSE_SOURCE_BUFFER);
if (outBuf == null) {
// fix for SYNAPSE 584. This is a temporaly fix becuase of HTTPCORE-208
shutdownConnection(conn);
return;
}
try {
int bytesWritten = outBuf.produceContent(encoder);
if (metrics != null && bytesWritten > 0) {
metrics.incrementBytesSent(bytesWritten);
}
if (encoder.isCompleted()) {