* we would have a problem when we flush the response. This is because
* the 1.6 SSLOutputWriter tries to cast the workerthread to a 1.6 object
* which will fail because we are still executing in a 1.0 worker.
* So, as of now the best way to send a response is from here.
*/
SSLOutputBuffer outputBuffer = (SSLOutputBuffer) response.getOutputBuffer();
sslErrorBuffer.clear();
MimeHeaders headers = response.getMimeHeaders();
Enumeration names = headers.names();
write(LoadBalancerProxyConstants.HTTP_11, sslErrorBuffer);
write(response.getStatus() + " ", sslErrorBuffer);
write(response.getMessage(), sslErrorBuffer);
write(LoadBalancerProxyConstants.CRLF, sslErrorBuffer);
while (names.hasMoreElements()) {
String headername = (String) names.nextElement();
String headervalue = headers.getHeader(headername);
write(headername + ": " + headervalue, sslErrorBuffer);
write(LoadBalancerProxyConstants.CRLF, sslErrorBuffer);
}
write(LoadBalancerProxyConstants.CRLF, sslErrorBuffer);
sslErrorBuffer.flip();
try {
SSLOutputWriter.flushChannel(outputBuffer.getChannel(),
sslErrorBuffer.slice());
} catch (IOException ex) {
_logger.log(Level.SEVERE, "clb.proxy.handler_ssl_error_failed", ex);
}
}