Scoop API

scoop:scoop.http:0.1.0

src/native/http2.scoop

Selected production source · src/native/http2.scoop

1package scoop.http
3@CLayout internal struct NativeHttp2Output(val count: Long, val code: Int, val streamId: Int, val kind: Int)
4@CLayout internal struct NativeHttp2InputProgress(val count: Long, val streamId: Int)
6@Extern(name = "scoop_http2_new") internal fun http2New(server: Int, config: NativeHttp2Config, settings: NativeHttp2Settings, upgrading: Int): ULong
7@Extern(name = "scoop_http2_free") internal fun http2Free(handle: ULong)
8@Extern(name = "scoop_http2_error") internal fun http2Error(handle: ULong): Ptr<Byte>
9@Extern(name = "scoop_http2_receive") internal fun http2Receive(handle: ULong, data: Ptr<Byte>, size: Long, capture: Int): NativeHttpStep
10@Extern(name = "scoop_http2_input_progress_count") internal fun http2InputProgressCount(handle: ULong): Long
11@Extern(name = "scoop_http2_input_progress") internal fun http2InputProgress(handle: ULong, index: Long): NativeHttp2InputProgress
12@Extern(name = "scoop_http2_output") internal fun http2Output(handle: ULong, data: Ptr<Byte>, capacity: Long): NativeHttp2Output
13@Extern(name = "scoop_http2_wants") internal fun http2Wants(handle: ULong, write: Int): Int
14@Extern(name = "scoop_http2_pending") internal fun http2Pending(handle: ULong, id: Int): Int
15@Extern(name = "scoop_http2_buffered") internal fun http2Buffered(handle: ULong): Long
16@Extern(name = "scoop_http2_next") internal fun http2Next(handle: ULong): ULong
17@Extern(name = "scoop_http2_end") internal fun http2End(handle: ULong): Int
18@GCLeaf @Extern(name = "scoop_http2_is_unexpected_eof") internal fun http2IsUnexpectedEof(code: Int): Int
19@Extern(name = "scoop_http2_goaway") internal fun http2Goaway(handle: ULong, last: Int, code: UInt, data: Ptr<Byte>, size: Long): Int
20@Extern(name = "scoop_http2_upgrade") internal fun http2Upgrade(handle: ULong, data: Ptr<Byte>, size: Long, head: Int): Int
22@Extern(name = "scoop_http2_fields_new") internal fun http2FieldsNew(): ULong
23@Extern(name = "scoop_http2_fields_free") internal fun http2FieldsFree(handle: ULong)
24@Extern(name = "scoop_http2_field_add") internal fun http2FieldAdd(handle: ULong, name: Ptr<Byte>, nameSize: Long, value: Ptr<Byte>, valueSize: Long, neverIndex: Int): Int
25@Extern(name = "scoop_http2_request") internal fun http2Request(handle: ULong, fields: ULong, end: Int, length: Long): Int
26@Extern(name = "scoop_http2_response") internal fun http2Response(handle: ULong, id: Int, fields: ULong, status: Int, end: Int, length: Long): Int
27@Extern(name = "scoop_http2_write") internal fun http2Write(handle: ULong, id: Int, data: Ptr<Byte>?, size: Long): NativeHttpStep
28@Extern(name = "scoop_http2_finish") internal fun http2Finish(handle: ULong, id: Int, fields: ULong): Int
29@Extern(name = "scoop_http2_consume") internal fun http2Consume(handle: ULong, id: Int, count: Long): Int
30@Extern(name = "scoop_http2_reset") internal fun http2Reset(handle: ULong, id: Int, code: UInt): Int
32internal fun http2Failure(operation: String, code: Int, detail: String, streamId: Int = 0,
33 scope: HttpFailureScope = HttpFailureScope.Operation): HttpException {
34 @Unsafe {
35 return HttpException(operation, HttpProtocol.Http2, scope, streamId, "nghttp2 1.70.0", code, detail,
36 http2IsUnexpectedEof(code) != 0)
37 }