Scoop API

scoop:scoop.http.server:0.1.0

src/completion.scoop

Selected production source · src/completion.scoop

1package scoop.http.server
3import scoop.http.HttpProtocol
4import scoop.platform.net.SocketAddress
5import scoop.time.Duration
6import scoop.tls.TlsConnectionInfo
8/** Immutable connection metadata; forwarded headers never replace these socket addresses. */
9public class HttpConnectionInfo public constructor(
10 /** The actual local socket address. */
11 public val localAddress: SocketAddress,
12 /** The actual peer socket address. */
13 public val peerAddress: SocketAddress,
14 /** The selected HTTP framing protocol. */
15 public val protocol: HttpProtocol,
16 /** Negotiated TLS facts, or None for a cleartext connection. */
17 public val tls: TlsConnectionInfo? = None
20/** The request pipeline's final outcome after cleanup. */
21public enum HttpRequestOutcome {
22 /** The pipeline and resource cleanup completed normally. */
23 Completed,
24 /** An explicit protocol upgrade completed its HTTP pipeline and cleanup. */
25 Upgraded,
26 /** Cooperative request cancellation, including deadline expiration. */
27 Cancelled,
28 /** An unrecovered pipeline or cleanup error. */
29 Failed
32/** Completion facts detached from the mutable request and its resource lifetimes. */
33public class HttpRequestCompletion internal constructor(
34 /** The request identifier supplied by the server or the application caller. */
35 public val requestId: String,
36 /** The selected route, absent for an unmatched fallback or special target. */
37 public val route: HttpRouteInfo?,
38 /** The original method token. */
39 public val method: String,
40 /** The submitted final status, absent if no response was submitted. */
41 public val status: UInt?,
42 /** Time through response completion and request cleanup. */
43 public val elapsed: Duration,
44 /** Body bytes received after protocol framing removal. */
45 public val receivedBytes: Long,
46 /** Body bytes delivered after any installed content decoding. */
47 public val deliveredBytes: Long,
48 /** Response content accepted from the producer. */
49 public val responseBytes: Long,
50 /** Response content accepted by HTTP, excluding framing and TLS overhead. */
51 public val encodedResponseBytes: Long,
52 /** The final pipeline outcome, independent of an already-sent success status. */
53 public val outcome: HttpRequestOutcome,
54 /** The terminal failure when the pipeline did not complete normally. */
55 public val failure: Throwable?