@freqhole/midden 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/midden.d.ts +21 -0
- package/midden_bg.js +28 -7
- package/midden_bg.wasm +0 -0
- package/package.json +1 -1
package/midden.d.ts
CHANGED
|
@@ -18,6 +18,15 @@ export type ReadableStreamType = "bytes";
|
|
|
18
18
|
* the send and recv halves use RefCell<Option<...>> so that async read
|
|
19
19
|
* and write operations can proceed concurrently (safe because WASM is
|
|
20
20
|
* single-threaded).
|
|
21
|
+
*
|
|
22
|
+
* also holds the parent `Connection` handle, purely to keep the QUIC
|
|
23
|
+
* connection alive for as long as this stream is alive: iroh/quinn tears
|
|
24
|
+
* a connection down once its last `Connection` handle is dropped, and
|
|
25
|
+
* neither `accept()` nor `open_bi()` keep any other handle around after
|
|
26
|
+
* handing a `BiStream` to JS. without this field, the connection was
|
|
27
|
+
* dropped (and the peer's in-flight read failed with "connection lost")
|
|
28
|
+
* the moment `accept()`/`open_bi()` returned - often before a response
|
|
29
|
+
* written moments later on the same stream even finished flushing.
|
|
21
30
|
*/
|
|
22
31
|
export class BiStream {
|
|
23
32
|
private constructor();
|
|
@@ -233,6 +242,18 @@ export class MiddenNode {
|
|
|
233
242
|
*
|
|
234
243
|
* the caller should check `stream.alpn()` to route the connection
|
|
235
244
|
* to the appropriate handler.
|
|
245
|
+
*
|
|
246
|
+
* a single incoming attempt failing during the TLS handshake (e.g. the
|
|
247
|
+
* peer aborts mid-handshake - normal during connection-path racing, or
|
|
248
|
+
* a peer that redials before noticing an earlier attempt is still
|
|
249
|
+
* live) does not end this call: it's logged and the loop moves on to
|
|
250
|
+
* the next queued incoming connection. propagating that failure to the
|
|
251
|
+
* caller instead would surface as a JS-level error on every accept()
|
|
252
|
+
* call, forcing the caller through a full error-handling/backoff cycle
|
|
253
|
+
* (see `IrohNetworkAdapter`'s accept loop) before the next, perfectly
|
|
254
|
+
* good, already-queued connection is even looked at - under a burst of
|
|
255
|
+
* aborted handshakes this can visibly stall new connections from ever
|
|
256
|
+
* completing.
|
|
236
257
|
*/
|
|
237
258
|
accept(): Promise<any>;
|
|
238
259
|
/**
|
package/midden_bg.js
CHANGED
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
* the send and recv halves use RefCell<Option<...>> so that async read
|
|
9
9
|
* and write operations can proceed concurrently (safe because WASM is
|
|
10
10
|
* single-threaded).
|
|
11
|
+
*
|
|
12
|
+
* also holds the parent `Connection` handle, purely to keep the QUIC
|
|
13
|
+
* connection alive for as long as this stream is alive: iroh/quinn tears
|
|
14
|
+
* a connection down once its last `Connection` handle is dropped, and
|
|
15
|
+
* neither `accept()` nor `open_bi()` keep any other handle around after
|
|
16
|
+
* handing a `BiStream` to JS. without this field, the connection was
|
|
17
|
+
* dropped (and the peer's in-flight read failed with "connection lost")
|
|
18
|
+
* the moment `accept()`/`open_bi()` returned - often before a response
|
|
19
|
+
* written moments later on the same stream even finished flushing.
|
|
11
20
|
*/
|
|
12
21
|
export class BiStream {
|
|
13
22
|
static __wrap(ptr) {
|
|
@@ -514,6 +523,18 @@ export class MiddenNode {
|
|
|
514
523
|
*
|
|
515
524
|
* the caller should check `stream.alpn()` to route the connection
|
|
516
525
|
* to the appropriate handler.
|
|
526
|
+
*
|
|
527
|
+
* a single incoming attempt failing during the TLS handshake (e.g. the
|
|
528
|
+
* peer aborts mid-handshake - normal during connection-path racing, or
|
|
529
|
+
* a peer that redials before noticing an earlier attempt is still
|
|
530
|
+
* live) does not end this call: it's logged and the loop moves on to
|
|
531
|
+
* the next queued incoming connection. propagating that failure to the
|
|
532
|
+
* caller instead would surface as a JS-level error on every accept()
|
|
533
|
+
* call, forcing the caller through a full error-handling/backoff cycle
|
|
534
|
+
* (see `IrohNetworkAdapter`'s accept loop) before the next, perfectly
|
|
535
|
+
* good, already-queued connection is even looked at - under a burst of
|
|
536
|
+
* aborted handshakes this can visibly stall new connections from ever
|
|
537
|
+
* completing.
|
|
517
538
|
* @returns {Promise<any>}
|
|
518
539
|
*/
|
|
519
540
|
accept() {
|
|
@@ -2085,37 +2106,37 @@ export function __wbg_write_e557b5312ec23477() { return handleError(function (ar
|
|
|
2085
2106
|
return ret;
|
|
2086
2107
|
}, arguments); }
|
|
2087
2108
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
2088
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
2109
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3531, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2089
2110
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_eec8db4f48ed3396___convert__closures_____invoke___wasm_bindgen_eec8db4f48ed3396___JsValue______true_);
|
|
2090
2111
|
return ret;
|
|
2091
2112
|
}
|
|
2092
2113
|
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
|
2093
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
2114
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 5577, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2094
2115
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_eec8db4f48ed3396___convert__closures_____invoke___wasm_bindgen_eec8db4f48ed3396___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_eec8db4f48ed3396___JsError___true_);
|
|
2095
2116
|
return ret;
|
|
2096
2117
|
}
|
|
2097
2118
|
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
|
2098
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx:
|
|
2119
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 2809, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2099
2120
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_eec8db4f48ed3396___convert__closures_____invoke___web_sys_a9844cda14584e26___features__gen_CloseEvent__CloseEvent______true_);
|
|
2100
2121
|
return ret;
|
|
2101
2122
|
}
|
|
2102
2123
|
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
|
2103
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx:
|
|
2124
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 4162, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2104
2125
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_eec8db4f48ed3396___convert__closures_____invoke___web_sys_a9844cda14584e26___features__gen_MessageEvent__MessageEvent______true_);
|
|
2105
2126
|
return ret;
|
|
2106
2127
|
}
|
|
2107
2128
|
export function __wbindgen_cast_0000000000000005(arg0, arg1) {
|
|
2108
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
2129
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 3450, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2109
2130
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_eec8db4f48ed3396___convert__closures_____invoke_______true_);
|
|
2110
2131
|
return ret;
|
|
2111
2132
|
}
|
|
2112
2133
|
export function __wbindgen_cast_0000000000000006(arg0, arg1) {
|
|
2113
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
2134
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 3704, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
2114
2135
|
const ret = makeClosure(arg0, arg1, wasm_bindgen_eec8db4f48ed3396___convert__closures_____invoke_______true__1_);
|
|
2115
2136
|
return ret;
|
|
2116
2137
|
}
|
|
2117
2138
|
export function __wbindgen_cast_0000000000000007(arg0, arg1) {
|
|
2118
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
2139
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 5541, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2119
2140
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_eec8db4f48ed3396___convert__closures_____invoke_______true__2_);
|
|
2120
2141
|
return ret;
|
|
2121
2142
|
}
|
package/midden_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED