private void ensureConsumed() throws IOException { if (managedConn == null) { return; } try { if (attemptReuse) { // this will not trigger a callback from EofSensorInputStream EntityUtils.consume(wrappedEntity); managedConn.markReusable(); } else { managedConn.unmarkReusable(); } } finally { releaseManagedConnection(); } }
public boolean eofDetected(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { // there may be some cleanup required, such as // reading trailers after the response body: wrapped.close(); managedConn.markReusable(); } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }
@Override public boolean eofDetected(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { // there may be some cleanup required, such as // reading trailers after the response body: wrapped.close(); managedConn.markReusable(); } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }
private void ensureConsumed() throws IOException { if (managedConn == null) { return; } try { if (attemptReuse) { // this will not trigger a callback from EofSensorInputStream EntityUtils.consume(wrappedEntity); managedConn.markReusable(); } else { managedConn.unmarkReusable(); } } finally { releaseManagedConnection(); } }
private void ensureConsumed() throws IOException { if (managedConn == null) { return; } try { if (attemptReuse) { // this will not trigger a callback from EofSensorInputStream EntityUtils.consume(wrappedEntity); managedConn.markReusable(); } else { managedConn.unmarkReusable(); } } finally { releaseManagedConnection(); } }
private void ensureConsumed() throws IOException { if (managedConn == null) { return; } try { if (attemptReuse) { // this will not trigger a callback from EofSensorInputStream EntityUtils.consume(wrappedEntity); managedConn.markReusable(); } else { managedConn.unmarkReusable(); } } finally { releaseManagedConnection(); } }
public boolean eofDetected(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { // there may be some cleanup required, such as // reading trailers after the response body: wrapped.close(); managedConn.markReusable(); } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }
@Override public boolean eofDetected(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { // there may be some cleanup required, such as // reading trailers after the response body: wrapped.close(); managedConn.markReusable(); } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }
public boolean streamClosed(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { final boolean valid = managedConn.isOpen(); // this assumes that closing the stream will // consume the remainder of the response body: try { wrapped.close(); managedConn.markReusable(); } catch (final SocketException ex) { if (valid) { throw ex; } } } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }
@Override public boolean streamClosed(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { final boolean valid = managedConn.isOpen(); // this assumes that closing the stream will // consume the remainder of the response body: try { wrapped.close(); managedConn.markReusable(); } catch (final SocketException ex) { if (valid) { throw ex; } } } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }
public boolean streamClosed(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { final boolean valid = managedConn.isOpen(); // this assumes that closing the stream will // consume the remainder of the response body: try { wrapped.close(); managedConn.markReusable(); } catch (final SocketException ex) { if (valid) { throw ex; } } } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }
@Override public boolean streamClosed(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { final boolean valid = managedConn.isOpen(); // this assumes that closing the stream will // consume the remainder of the response body: try { wrapped.close(); managedConn.markReusable(); } catch (final SocketException ex) { if (valid) { throw ex; } } } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }