@Override protected void reset() { super.reset(); parser.reset(); }
protected void reset() throws IOException { _connectionHeader = null; _parser.reset(); _generator.reset(); _http11 = true; }
/** * Parse until {@link #STATE_END END} state. * If the parser is already in the END state, then it is {@link #reset reset} and re-parsed. * @throws IllegalStateException If the buffers have already been partially parsed. */ public void parse() throws IOException { if (_state==STATE_END) reset(); if (_state!=STATE_START) throw new IllegalStateException("!START"); // continue parsing while (_state != STATE_END) if (parseNext()<0) return; }
/** * Parse until {@link #STATE_END END} state. * If the parser is already in the END state, then it is {@link #reset reset} and re-parsed. * @throws IllegalStateException If the buffers have already been partially parsed. */ public void parse() throws IOException { if (_state==STATE_END) reset(); if (_state!=STATE_START) throw new IllegalStateException("!START"); // continue parsing while (_state != STATE_END) if (parseNext()<0) return; }
/** * Parse until {@link #STATE_END END} state. * If the parser is already in the END state, then it is {@link #reset reset} and re-parsed. * @throws IllegalStateException If the buffers have already been partially parsed. */ public void parse() throws IOException { if (_state==STATE_END) reset(); if (_state!=STATE_START) throw new IllegalStateException("!START"); // continue parsing while (_state != STATE_END) if (parseNext()<0) return; }
/** * Parse until {@link #STATE_END END} state. * If the parser is already in the END state, then it is {@link #reset reset} and re-parsed. * @throws IllegalStateException If the buffers have already been partially parsed. */ public void parse() throws IOException { if (_state==STATE_END) reset(); if (_state!=STATE_START) throw new IllegalStateException("!START"); // continue parsing while (_state != STATE_END) if (parseNext()<0) return; }
/** * Parse until {@link #STATE_END END} state. * If the parser is already in the END state, then it is {@link #reset reset} and re-parsed. * @throws IllegalStateException If the buffers have already been partially parsed. */ public void parse() throws IOException { if (_state==STATE_END) reset(); if (_state!=STATE_START) throw new IllegalStateException("!START"); // continue parsing while (_state != STATE_END) if (parseNext()<0) return; }
public void onResponseComplete() throws IOException { _exchange.setEventListener(_next); _exchange.setStatus(HttpExchange.STATUS_WAITING_FOR_RESPONSE); _parser.reset(); }
public void reset() { // If we are still expecting if (_channel.isExpecting100Continue()) { // reset to avoid seeking remaining content _parser.reset(); // close to seek EOF _parser.close(); } // else if we are persistent else if (_generator.isPersistent()) // reset to seek next request _parser.reset(); else // else seek EOF _parser.close(); _generator.reset(); _channel.reset(); releaseRequestBuffer(); if (_chunk!=null) { _bufferPool.release(_chunk); _chunk=null; } }
public void reset() { // If we are still expecting if (_channel.isExpecting100Continue()) { // reset to avoid seeking remaining content _parser.reset(); // close to seek EOF _parser.close(); } // else if we are persistent else if (_generator.isPersistent()) // reset to seek next request _parser.reset(); else // else seek EOF _parser.close(); _generator.reset(); _channel.reset(); releaseRequestBuffer(); if (_chunk!=null) { _bufferPool.release(_chunk); _chunk=null; } }
protected boolean success() { HttpExchange exchange = connection.getExchange(); if (exchange == null) return false; AtomicMarkableReference<Result> completion = exchange.responseComplete(null); if (!completion.isMarked()) return false; parser.reset(); decoder = null; if (!updateState(State.RECEIVE, State.IDLE)) throw new IllegalStateException(); exchange.terminateResponse(); HttpResponse response = exchange.getResponse(); List<Response.ResponseListener> listeners = exchange.getConversation().getResponseListeners(); ResponseNotifier notifier = connection.getDestination().getResponseNotifier(); notifier.notifySuccess(listeners, response); LOG.debug("Received {}", response); Result result = completion.getReference(); if (result != null) { connection.complete(exchange, !result.isFailed()); notifier.notifyComplete(listeners, result); } return true; }
protected boolean success() { HttpExchange exchange = connection.getExchange(); if (exchange == null) return false; AtomicMarkableReference<Result> completion = exchange.responseComplete(null); if (!completion.isMarked()) return false; parser.reset(); decoder = null; if (!updateState(State.RECEIVE, State.IDLE)) throw new IllegalStateException(); exchange.terminateResponse(); HttpResponse response = exchange.getResponse(); List<Response.ResponseListener> listeners = exchange.getConversation().getResponseListeners(); ResponseNotifier notifier = connection.getDestination().getResponseNotifier(); notifier.notifySuccess(listeners, response); LOG.debug("Received {}", response); Result result = completion.getReference(); if (result != null) { connection.complete(exchange, !result.isFailed()); notifier.notifyComplete(listeners, result); } return true; }