boolean keptAlive = false;
while (!error && !endpoint.isPaused()) {
-
// Parsing the request header
try {
// Get first message of the request
error = true;
break;
}
-
keptAlive = true;
request.setStartTime(System.currentTimeMillis());
} catch (IOException e) {
}
}
+ if (endpoint.isPaused()) {
+ // 503 - Service unavailable
+ response.setStatus(503);
+ adapter.log(request, response, 0);
+ error = true;
+ }
+
// Process the request in the adapter
if (!error) {
try {
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
-
- if (error || endpoint.isPaused()) {
- return SocketState.CLOSED;
- } else if (isAsync()) {
- return SocketState.LONG;
+
+ if (!error && !endpoint.isPaused()) {
+ if (isAsync()) {
+ return SocketState.LONG;
+ } else {
+ return SocketState.OPEN;
+ }
} else {
- return SocketState.OPEN;
+ return SocketState.CLOSED;
}
}
SocketStatus.OPEN);
}
} else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
- if (param==null) return;
+ if (param == null) return;
long timeout = ((Long)param).longValue();
socket.setTimeout(timeout);
} else if (actionCode == ActionCode.ASYNC_DISPATCH) {
SocketStatus.OPEN);
}
}
-
-
}