apache/tomcat70 — pull request #2 by chainho (2013-11-18 07:22:09+00:00)
Title: update ajp connector when it was in using

hi,I found an issue like this:
in every application server that use embed tomcat, when the ajp connector was in using, just like blow code:
```
while (!error && !endpoint.isPaused()) {
// Parsing the request header
try {
// Set keep alive timeout if enabled
if (keepAliveTimeout > 0) {
socket.getSocket().setSoTimeout(keepAliveTimeout);
}
// Get first message of the request
if (!readMessage(requestHeaderMessage)) {
// This means a connection timeout
break;
}
//add start ajp connector was updated when it was in using this will break
if(endpoint.isUpdated()) {
break;
}//add end
```
then update the ajp connector. Now the connector will destory and recreate. But in above code, the connection was still in use. When request coming, a NullPointerException will throw in code ```adapter.log(request,response,0);```
```
if (!error) {
// Setting up filters, and parse some request headers
rp.setStage(com.tongweb.web.oro.Constants.STAGE_PREPARE);
try {
prepareRequest();
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log.debug(sm.getString("ajpprocessor.request.prepare"), t);
// 400 - Internal Server Error
response.setStatus(400);
adapter.log(request, response, 0);
error = true;
}
}
```

And I think add an attribute, when it was updated, then break and use a new connection will solve this problem.