}
HttpParamsLinker.link(request, this.params);
requestExec.postProcess(response, httpProcessor, context);
RoutedRequest followup =
handleResponse(roureq, request, response, context);
if (followup == null) {
done = true;
} else {
if (this.reuseStrategy.keepAlive(response, context)) {
LOG.debug("Connection kept alive");
// Make sure the response body is fully consumed, if present
HttpEntity entity = response.getEntity();
if (entity != null) {
entity.consumeContent();
}
} else {
managedConn.close();
}
// check if we can use the same connection for the followup
if ((managedConn != null) &&
!followup.getRoute().equals(roureq.getRoute())) {
// the followup has a different route, release conn
//@@@ need to consume response body first?
//@@@ or let that be done in handleResponse(...)?
connManager.releaseConnection(managedConn);
managedConn = null;