error = false;
keepAlive = true;
- int keepAliveLeft = maxKeepAliveRequests>0?socketWrapper.decrementKeepAlive():-1;
+ if (maxKeepAliveRequests > 0) {
+ socketWrapper.decrementKeepAlive();
+ }
int soTimeout = endpoint.getSoTimeout();
}
// Disable keep-alive if we are running low on threads
if (threadRatio > getDisableKeepAlivePercentage()) {
- keepAliveLeft = 1;
+ socketWrapper.setKeepAliveLeft(0);
}
try {
}
}
- if (maxKeepAliveRequests > 0 && keepAliveLeft == 0)
+ if (socketWrapper.getKeepAliveLeft() == 0) {
keepAlive = false;
+ }
// Process the request in the adapter
if (!error) {
break;
}
- keepAliveLeft =
- maxKeepAliveRequests>0?socketWrapper.decrementKeepAlive():-1;
+ if (maxKeepAliveRequests > 0) {
+ socketWrapper.decrementKeepAlive();
+ }
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);