throws IOException
{
_hasRequest = false;
SocketLink conn = getConnection();
Server server = getServer();
Thread thread = Thread.currentThread();
ClassLoader oldLoader = thread.getContextClassLoader();
try {
thread.setContextClassLoader(server.getClassLoader());
HttpBufferStore httpBuffer = HttpBufferStore.allocate((Server) server);
startRequest(httpBuffer);
startInvocation();
ReadStream is = getRawRead();
WriteStream os = getRawWrite();
_filter.init(is, os);
_writeStream.init(_filter);
// _writeStream.setWritePrefix(3);
try {
_hasRequest = false;
while (readPacket(is)) {
}
if (! _hasRequest) {
if (log.isLoggable(Level.FINE))
log.fine(dbgId() + "read timeout");
return false;
}
startInvocation();
_isSecure = conn.isSecure() || conn.getLocalPort() == 443;
/*
if (_protocol.length() == 0)
_protocol.append("HTTP/0.9");
if (log.isLoggable(Level.FINE)) {
log.fine(dbgId() + _method + " " +
new String(_uri, 0, _uriLength) + " " + _protocol);
log.fine(dbgId() + "Remote-IP: " + _conn.getRemoteHost() + ":" + _conn.getRemotePort());
}
parseHeaders(_rawRead);
if (getVersion() >= HTTP_1_1 && isForce10()) {
_protocol.clear();
_protocol.append("HTTP/1.0");
_version = HTTP_1_0;
}
*/
} catch (ClientDisconnectException e) {
throw e;
} catch (Throwable e) {
log.log(Level.FINER, e.toString(), e);
throw new BadRequestException(String.valueOf(e), e);
}
CharSequence host = getHost();
String ipHost = conn.getVirtualHost();
if (ipHost != null)
host = ipHost;
_invocationKey.init(_isSecure,
host, conn.getLocalPort(),
_uri, _uriLength);
Invocation invocation = getInvocation(host);
if (invocation == null)
return false;
getRequestFacade().setInvocation(invocation);
startInvocation();
invocation.service(getRequestFacade(), getResponseFacade());
} catch (ClientDisconnectException e) {
// XXX: _response.killCache();
throw e;
} catch (Throwable e) {
log.log(Level.FINE, e.toString(), e);
// XXX: _response.killCache();
killKeepalive();
/*
try {
getErrorManager().sendServletError(e, this, _response);
} catch (ClientDisconnectException e1) {
throw e1;
} catch (Throwable e1) {
log.log(Level.FINE, e1.toString(), e1);
}
*/
WebApp webApp = server.getDefaultWebApp();
if (webApp != null)
webApp.accessLog(getRequestFacade(), getResponseFacade());
return false;
} finally {