private void pushRequestLater(int streamId, List<Header> requestHeaders) { synchronized (this) { if (this.currentPushRequests.contains(Integer.valueOf(streamId))) { writeSynResetLater(streamId, ErrorCode.PROTOCOL_ERROR); return; } this.currentPushRequests.add(Integer.valueOf(streamId)); final int i = streamId; final List<Header> list = requestHeaders; this.pushExecutor.execute(new NamedRunnable("OkHttp %s Push Request[%s]", new Object[]{this.hostName, Integer.valueOf(streamId)}) { public void execute() { if (FramedConnection.this.pushObserver.onRequest(i, list)) { try { FramedConnection.this.frameWriter.rstStream(i, ErrorCode.CANCEL); synchronized (FramedConnection.this) { FramedConnection.this.currentPushRequests.remove(Integer.valueOf (i)); } } catch (IOException e) { } } } }); } }
private void pushHeadersLater(int streamId, List<Header> requestHeaders, boolean inFinished) { final int i = streamId; final List<Header> list = requestHeaders; final boolean z = inFinished; this.pushExecutor.execute(new NamedRunnable("OkHttp %s Push Headers[%s]", new Object[]{this.hostName, Integer.valueOf(streamId)}) { public void execute() { boolean cancel = FramedConnection.this.pushObserver.onHeaders(i, list, z); if (cancel) { try { FramedConnection.this.frameWriter.rstStream(i, ErrorCode.CANCEL); } catch (IOException e) { return; } } if (cancel || z) { synchronized (FramedConnection.this) { FramedConnection.this.currentPushRequests.remove(Integer.valueOf(i)); } } } }); }
final void writeSynResetLater(final int paramInt, final ErrorCode paramErrorCode) { ExecutorService localExecutorService = executor; Object[] arrayOfObject = new Object[2]; arrayOfObject[0] = this.hostName; arrayOfObject[1] = Integer.valueOf(paramInt); localExecutorService.submit(new NamedRunnable("OkHttp %s stream %d", arrayOfObject) { public final void execute() { try { SpdyConnection.this.writeSynReset(paramInt, paramErrorCode); return; } catch (IOException localIOException) {} } }); }
final void writeWindowUpdateLater(final int paramInt, final long paramLong) { ExecutorService localExecutorService = executor; Object[] arrayOfObject = new Object[2]; arrayOfObject[0] = this.hostName; arrayOfObject[1] = Integer.valueOf(paramInt); localExecutorService.submit(new NamedRunnable("OkHttp Window Update %s stream %d", arrayOfObject) { public final void execute() { try { SpdyConnection.this.frameWriter.windowUpdate(paramInt, paramLong); return; } catch (IOException localIOException) {} } }); }
private void ackSettingsLater(final Settings peerSettings) { FramedConnection.executor.execute(new NamedRunnable("OkHttp %s ACK Settings", new Object[]{FramedConnection.this.hostName}) { public void execute() { try { FramedConnection.this.frameWriter.ackSettings(peerSettings); } catch (IOException e) { } } }); }
void writeSynResetLater(int streamId, ErrorCode errorCode) { final int i = streamId; final ErrorCode errorCode2 = errorCode; executor.submit(new NamedRunnable("OkHttp %s stream %d", new Object[]{this.hostName, Integer.valueOf(streamId)}) { public void execute() { try { FramedConnection.this.writeSynReset(i, errorCode2); } catch (IOException e) { } } }); }
void writeWindowUpdateLater(int streamId, long unacknowledgedBytesRead) { final int i = streamId; final long j = unacknowledgedBytesRead; executor.execute(new NamedRunnable("OkHttp Window Update %s stream %d", new Object[]{this .hostName, Integer.valueOf(streamId)}) { public void execute() { try { FramedConnection.this.frameWriter.windowUpdate(i, j); } catch (IOException e) { } } }); }
private void writePingLater(boolean reply, int payload1, int payload2, Ping ping) { final boolean z = reply; final int i = payload1; final int i2 = payload2; final Ping ping2 = ping; executor.execute(new NamedRunnable("OkHttp %s ping %08x%08x", new Object[]{this.hostName, Integer.valueOf(payload1), Integer.valueOf(payload2)}) { public void execute() { try { FramedConnection.this.writePing(z, i, i2, ping2); } catch (IOException e) { } } }); }
private void pushDataLater(int streamId, BufferedSource source, int byteCount, boolean inFinished) throws IOException { final Buffer buffer = new Buffer(); source.require((long) byteCount); source.read(buffer, (long) byteCount); if (buffer.size() != ((long) byteCount)) { throw new IOException(buffer.size() + " != " + byteCount); } final int i = streamId; final int i2 = byteCount; final boolean z = inFinished; this.pushExecutor.execute(new NamedRunnable("OkHttp %s Push Data[%s]", new Object[]{this .hostName, Integer.valueOf(streamId)}) { public void execute() { try { boolean cancel = FramedConnection.this.pushObserver.onData(i, buffer, i2, z); if (cancel) { FramedConnection.this.frameWriter.rstStream(i, ErrorCode.CANCEL); } if (cancel || z) { synchronized (FramedConnection.this) { FramedConnection.this.currentPushRequests.remove(Integer.valueOf(i)); } } } catch (IOException e) { } } }); }
private void pushResetLater(int streamId, ErrorCode errorCode) { final int i = streamId; final ErrorCode errorCode2 = errorCode; this.pushExecutor.execute(new NamedRunnable("OkHttp %s Push Reset[%s]", new Object[]{this.hostName, Integer.valueOf(streamId)}) { public void execute() { FramedConnection.this.pushObserver.onReset(i, errorCode2); synchronized (FramedConnection.this) { FramedConnection.this.currentPushRequests.remove(Integer.valueOf(i)); } } }); }
void writeSynResetLater(final int streamId, final ErrorCode errorCode) { executor.submit(new NamedRunnable("OkHttp SPDY Writer %s stream %d", hostName, streamId) { @Override public void execute() { try { writeSynReset(streamId, errorCode); } catch (IOException ignored) { } } }); }
void writeWindowUpdateLater(final int streamId, final int deltaWindowSize) { executor.submit(new NamedRunnable("OkHttp SPDY Writer %s stream %d", hostName, streamId) { @Override public void execute() { try { writeWindowUpdate(streamId, deltaWindowSize); } catch (IOException ignored) { } } }); }
private void writePingLater( final boolean reply, final int payload1, final int payload2, final Ping ping) { executor.submit(new NamedRunnable("OkHttp SPDY Writer %s ping %08x%08x", hostName, payload1, payload2) { @Override public void execute() { try { writePing(reply, payload1, payload2, ping); } catch (IOException ignored) { } } }); }