@Override public void onClosed(Closeable closeable, CloseType type) throws IOException { if (isGracefullyFinishResponseOnClose()) { // Connection was closed. // This event is fired only for responses, which don't have // associated transfer-encoding or content-length. // We have to complete such a request-response processing gracefully. final FilterChain fc = (FilterChain) connection.getProcessor(); fc.fireEventUpstream(connection, new GracefulCloseEvent(HttpTransactionContext.this), null); } else if (CloseType.REMOTELY.equals(type)) { abort(AsyncHttpProviderUtils.REMOTELY_CLOSED_EXCEPTION); } else { try { closeable.assertOpen(); } catch (IOException ioe) { // unwrap the exception as it was wrapped by assertOpen. abort(ioe.getCause()); } } } };
@Override public void onClosed(Closeable closeable, CloseType type) throws IOException { if (isGracefullyFinishResponseOnClose() || isKeepAliveDisabled()) { // Connection was closed. // This event is fired only for responses, which don't have // associated transfer-encoding or content-length. // We have to complete such a request-response processing gracefully. final FilterChain fc = (FilterChain) connection.getProcessor(); fc.fireEventUpstream(connection, new GracefulCloseEvent(HttpTransactionContext.this), null); } else if (CloseType.REMOTELY.equals(type)) { abort(AsyncHttpProviderUtils.REMOTELY_CLOSED_EXCEPTION); } else { try { closeable.assertOpen(); } catch (IOException ioe) { // unwrap the exception as it was wrapped by assertOpen. abort(ioe.getCause()); } } } };
@Override public void onClosed(Closeable closeable, CloseType type) throws IOException { if (isGracefullyFinishResponseOnClose() || isKeepAliveDisabled()) { // Connection was closed. // This event is fired only for responses, which don't have // associated transfer-encoding or content-length. // We have to complete such a request-response processing gracefully. final FilterChain fc = (FilterChain) connection.getProcessor(); fc.fireEventUpstream(connection, new GracefulCloseEvent(HttpTransactionContext.this), null); } else if (CloseType.REMOTELY.equals(type)) { abort(AsyncHttpProviderUtils.REMOTELY_CLOSED_EXCEPTION); } else { try { closeable.assertOpen(); } catch (IOException ioe) { // unwrap the exception as it was wrapped by assertOpen. abort(ioe.getCause()); } } } };