List of usage examples for org.apache.http.impl.nio.client HttpExchange reset
public void reset()
From source file:org.apache.http.impl.nio.client.NHttpClientProtocolHandler.java
private void processResponse(final NHttpClientConnection conn, final HttpExchange httpexchange, final HttpAsyncExchangeHandler<?> handler) throws IOException { if (!httpexchange.isValid()) { conn.close();//from www . j a v a 2 s . c om } HttpRequest request = httpexchange.getRequest(); HttpResponse response = httpexchange.getResponse(); String method = request.getRequestLine().getMethod(); int status = response.getStatusLine().getStatusCode(); if (method.equalsIgnoreCase("CONNECT") && status == HttpStatus.SC_OK) { this.log.debug("CONNECT method succeeded"); conn.resetInput(); } else { if (!handler.keepAlive(response)) { conn.close(); } } if (this.log.isDebugEnabled()) { this.log.debug("Response processed " + formatState(conn, httpexchange)); } handler.responseCompleted(); httpexchange.reset(); }