public void streamFinished(boolean noNewStreams, HttpCodec codec, long bytesRead, IOException e) { eventListener.responseBodyEnd(call, bytesRead); Socket socket; Connection releasedConnection; boolean callEnd; synchronized (connectionPool) { if (codec == null || codec != this.codec) { throw new IllegalStateException("expected " + this.codec + " but was " + codec); } if (!noNewStreams) { connection.successCount++; } releasedConnection = connection; socket = deallocate(noNewStreams, false, true); if (connection != null) releasedConnection = null; callEnd = this.released; } closeQuietly(socket); if (releasedConnection != null) { eventListener.connectionReleased(call, releasedConnection); } if (e != null) { e = Internal.instance.timeoutExit(call, e); eventListener.callFailed(call, e); } else if (callEnd) { Internal.instance.timeoutExit(call, null); eventListener.callEnd(call); } }
public void release(boolean callEnd) { Socket socket; Connection releasedConnection; synchronized (connectionPool) { releasedConnection = connection; socket = deallocate(false, true, false); if (connection != null) releasedConnection = null; } closeQuietly(socket); if (releasedConnection != null) { if (callEnd) { Internal.instance.timeoutExit(call, null); } eventListener.connectionReleased(call, releasedConnection); if (callEnd) { eventListener.callEnd(call); } } }
public void streamFinished(boolean noNewStreams, HttpCodec codec, long bytesRead, IOException e) { eventListener.responseBodyEnd(call, bytesRead); Socket socket; Connection releasedConnection; boolean callEnd; synchronized (connectionPool) { if (codec == null || codec != this.codec) { throw new IllegalStateException("expected " + this.codec + " but was " + codec); } if (!noNewStreams) { connection.successCount++; } releasedConnection = connection; socket = deallocate(noNewStreams, false, true); if (connection != null) releasedConnection = null; callEnd = this.released; } closeQuietly(socket); if (releasedConnection != null) { eventListener.connectionReleased(call, releasedConnection); } if (e != null) { e = Internal.instance.timeoutExit(call, e); eventListener.callFailed(call, e); } else if (callEnd) { Internal.instance.timeoutExit(call, null); eventListener.callEnd(call); } }
public void release(boolean callEnd) { Socket socket; Connection releasedConnection; synchronized (connectionPool) { releasedConnection = connection; socket = deallocate(false, true, false); if (connection != null) releasedConnection = null; } closeQuietly(socket); if (releasedConnection != null) { if (callEnd) { Internal.instance.timeoutExit(call, null); } eventListener.connectionReleased(call, releasedConnection); if (callEnd) { eventListener.callEnd(call); } } }
public void streamFinished(boolean noNewStreams, HttpCodec codec, long bytesRead, IOException e) { eventListener.responseBodyEnd(call, bytesRead); Socket socket; Connection releasedConnection; boolean callEnd; synchronized (connectionPool) { if (codec == null || codec != this.codec) { throw new IllegalStateException("expected " + this.codec + " but was " + codec); } if (!noNewStreams) { connection.successCount++; } releasedConnection = connection; socket = deallocate(noNewStreams, false, true); if (connection != null) releasedConnection = null; callEnd = this.released; } closeQuietly(socket); if (releasedConnection != null) { eventListener.connectionReleased(call, releasedConnection); } if (e != null) { e = Internal.instance.timeoutExit(call, e); eventListener.callFailed(call, e); } else if (callEnd) { Internal.instance.timeoutExit(call, null); eventListener.callEnd(call); } }
public void release() { Socket socket; Connection releasedConnection; synchronized (connectionPool) { releasedConnection = connection; socket = deallocate(false, true, false); if (connection != null) releasedConnection = null; } closeQuietly(socket); if (releasedConnection != null) { Internal.instance.timeoutExit(call, null); eventListener.connectionReleased(call, releasedConnection); eventListener.callEnd(call); } }