long soTimeout = endpoint.getSoTimeout();
- int keepAliveLeft = maxKeepAliveRequests;
-
boolean keptAlive = false;
boolean openSocket = false;
boolean sendfileInProgress = false;
}
}
- if (maxKeepAliveRequests > 0 && --keepAliveLeft == 0)
+ if (maxKeepAliveRequests == 1) {
+ keepAlive = false;
+ } else if (maxKeepAliveRequests > 0 &&
+ socketWrapper.decrementKeepAlive() <= 0) {
keepAlive = false;
+ }
// Process the request in the adapter
if (!error) {
}
}
- if (maxKeepAliveRequests == 1 )
+ if (maxKeepAliveRequests == 1) {
keepAlive = false;
- if (maxKeepAliveRequests > 0 && socketWrapper.decrementKeepAlive() <= 0)
+ } else if (maxKeepAliveRequests > 0 &&
+ socketWrapper.decrementKeepAlive() <= 0) {
keepAlive = false;
+ }
// Process the request in the adapter
if (!error) {
int soTimeout = endpoint.getSoTimeout();
- if (maxKeepAliveRequests > 0) {
- socketWrapper.decrementKeepAlive();
- }
-
int threadRatio = -1;
// These may return zero or negative values
// Only calculate a thread ratio when both are >0 to ensure we get a
}
}
- if (socketWrapper.getKeepAliveLeft() == 0) {
+ if (maxKeepAliveRequests == 1) {
+ keepAlive = false;
+ } else if (maxKeepAliveRequests > 0 &&
+ socketWrapper.decrementKeepAlive() <= 0) {
keepAlive = false;
}
if (isAsync() || error || inputBuffer.lastValid == 0) {
break;
}
-
- if (maxKeepAliveRequests > 0) {
- socketWrapper.decrementKeepAlive();
- }
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);