final NHttpClientConnection conn,
final HttpExchange httpexchange,
final HttpAsyncClientExchangeHandler<?> handler) throws IOException {
HttpContext context = handler.getContext();
if (httpexchange.isValid()) {
HttpRequest request = httpexchange.getRequest();
HttpResponse response = httpexchange.getResponse();
String method = request.getRequestLine().getMethod();
int status = response.getStatusLine().getStatusCode();
if (!(method.equalsIgnoreCase("CONNECT") && status < 300)) {
ConnectionReuseStrategy connReuseStrategy = handler.getConnectionReuseStrategy();
if (!connReuseStrategy.keepAlive(response, context)) {
conn.close();