1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/// Default capacity of the bounded non-blocking `CandidateMailbox`.
pub const DEFAULT_CANDIDATE_MAILBOX_CAP: usize = 4;
/// Default maximum size in bytes allowed for a single downloaded artifact (`16 MiB`).
pub const DEFAULT_MAX_ARTIFACT_BYTES: u64 = 16 * 1024 * 1024;
/// Default HTTP connect and read timeout in milliseconds for update requests.
pub const DEFAULT_UPDATE_HTTP_TIMEOUT_MS: u64 = 5_000;
/// Default SSE reconnect backoff interval in milliseconds.
pub const DEFAULT_SSE_RECONNECT_MS: u64 = 100;
/// Dedicated OS thread name assigned to the background `UpdateWorker`.
pub const UPDATE_WORKER_THREAD_NAME: &str = "euv-update-worker";
/// HTTP scheme prefix accepted by `HttpReleaseTransport`.
pub const UPDATE_HTTP_SCHEME: &str = "http://";
/// HTTP header separator marking the end of response headers.
pub const HTTP_HEADER_END_MARKER: & = b"\r\n\r\n";
/// HTTP header name for SSE stream resume cursor.
pub const HDR_LAST_EVENT_ID: &str = "Last-Event-ID";
/// HTTP header name for byte-range resume requests.
pub const HDR_RANGE: &str = "Range";
/// HTTP transfer-encoding chunked token.
pub const HDR_TRANSFER_ENCODING_CHUNKED: &str = "chunked";
/// HTTP header key prefix for transfer encoding.
pub const HDR_TRANSFER_ENCODING_KEY: &str = "transfer-encoding";
/// HTTP header key prefix for content length.
pub const HDR_CONTENT_LENGTH_KEY: &str = "content-length";
/// SSE wire prefix for event identifier lines.
pub const SSE_WIRE_ID_PREFIX: &str = "id:";
/// SSE wire prefix for event type lines.
pub const SSE_WIRE_EVENT_PREFIX: &str = "event:";
/// SSE wire prefix for data payload lines.
pub const SSE_WIRE_DATA_PREFIX: &str = "data:";
/// Delivery mode query token for Wasm Component channel.
pub const QUERY_MODE_WASM: &str = "wasm_component";
/// Delivery mode query token for Declarative Data channel.
pub const QUERY_MODE_DATA: &str = "declarative_data";
/// Error message when a worker URL does not start with `http://`.
pub const ERR_INVALID_HTTP_BASE_URL: &str =
"update server base_url must use http://host:port";
/// Error message when a server returns a malformed HTTP response head.
pub const ERR_MALFORMED_HTTP_RESP: &str = "malformed HTTP response from update server";
/// Error message when an HTTP status code is not 200 or 206.
pub const ERR_HTTP_NON_OK: &str = "unexpected HTTP status from update server";
/// Error message when an artifact WASM binary fails ABI or export validation.
pub const ERR_WASM_ARTIFACT_ABI: &str = "wasm artifact failed host ABI export check";
/// Error message when a declarative artifact is not valid JSON `DynamicNodeSpec`.
pub const ERR_DECLARATIVE_JSON: &str =
"declarative artifact payload is not a valid DynamicNodeSpec";
/// Error message when a cross-route action is denied by host permissions.
pub const ERR_ACTION_DENIED: &str = "cross-route action is not permitted by host policy";
/// Error message when a cross-route action was cancelled before dispatch.
pub const ERR_ACTION_CANCELLED: &str =
"cross-route action cancelled by stale generation token";
/// Error message when no active release generation is installed on the runtime.
pub const ERR_NO_ACTIVE_GENERATION: &str = "no active release generation installed";
/// Error message when the background update worker thread cannot be spawned.
pub const ERR_WORKER_SPAWN: &str = "failed to spawn background update worker thread";
/// Error message when a network transport is unavailable on `wasm32` in synchronous mode.
pub const ERR_WASM32_SYNC_HTTP: &str =
"synchronous TCP HTTP transport unavailable on wasm32";