Scoop API

scoop:scoop.http.client:0.1.0

src/transport/notices.scoop

Selected production source · src/transport/notices.scoop

1package scoop.http.client
3import scoop.http.asyncio.AsyncHttp2Stream
5internal fun bindClientHttp2Stream(call: ClientCall, stream: AsyncHttp2Stream) {
6 call.lock.withLock { call.http2StreamId = Some(stream.id) }
7 val failure = stream.failure
8 if (clientPresent(failure)) { recordClientIoFailure(call, failure!!, true); failClientCall(call, failure!!) }
9}
11internal fun failClientHttp2Stream(state: ClientState, entry: ClientPoolEntry, id: Int, error: Throwable) {
12 val calls = state.lock.withLock { state.calls.toArray() }
13 for (call in calls) {
14 val matches = call.lock.withLock {
15 !call.completed && clientPresent(call.lease) && call.lease!! === entry && call.http2StreamId == Some(id)
16 }
17 if (matches) { recordClientIoFailure(call, error, true); failClientCall(call, error) }
18 }