if (version < HttpRequest.HTTP_1_0) {
_request.killKeepalive("http client version " + version);
return false;
}
TcpSocketLink tcpConn = null;
if (_request.getConnection() instanceof TcpSocketLink)
tcpConn = (TcpSocketLink) _request.getConnection();
WebApp webApp = request.getWebApp();
String contentType = response.getContentTypeImpl();
String charEncoding = response.getCharacterEncodingImpl();
WriteStream os = getRawWrite();
int statusCode = response.getStatus();
if (statusCode == 200) {
if (version < HttpRequest.HTTP_1_1)
os.write(_http10ok, 0, _http10ok.length);
else
os.write(_http11ok, 0, _http11ok.length);
} else {
if (version < HttpRequest.HTTP_1_1)
os.printLatin1("HTTP/1.0 ");
else
os.printLatin1("HTTP/1.1 ");
os.write((statusCode / 100) % 10 + '0');
os.write((statusCode / 10) % 10 + '0');
os.write(statusCode % 10 + '0');
os.write(' ');
os.printLatin1(response.getStatusMessage());
}
if (debug) {
log.fine(_request.dbgId() + "HTTP/1.1 " +
statusCode + " " + response.getStatusMessage());
}
boolean isUpgrade = false;
if (tcpConn != null && tcpConn.isDuplex()) {
isUpgrade = true;
String upgrade = getHeader("Upgrade");
if (upgrade != null) {