@webpodjs/net-worker 0.2.4 → 0.2.6

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/README.md CHANGED
@@ -18,6 +18,13 @@ produces frames into `toEngine`.
18
18
  shows no total size (curl's or npm's progress); a CORS proxy route keeps the length.
19
19
  - **Inbound**: page connections (`pod.fetch`, `pod.net.connect`, `pod.net.expose` previews)
20
20
  arrive as `inbound` MessagePorts and become TCP connections to the guest.
21
+ - **Header bytes** (T320): header values and reason phrases cross between the guest's bytes and the page's
22
+ ByteStrings one char per byte, as a browser's `fetch()` and `Headers` have them, both ways: a guest
23
+ server's raw UTF-8 or latin1 value reaches `pod.fetch` and previews as `fetch()` would show it, a
24
+ page's value reaches the guest as its bytes, and so between the guest's HTTP clients and `fetch()` (a
25
+ value from 0x80 was decoded as UTF-8: no ByteString, which `Headers` refused, and the other way its
26
+ chars' UTF-8). A char above U+00FF (no ByteString) goes as its UTF-8. A CORS proxy's JSON envelope
27
+ carries text: a value's bytes read as UTF-8, as before.
21
28
 
22
29
  `crates/webpod-net-wasm` is the wasm module (`NetPod`); `src/worker.js` moves frames and runs it.
23
30
 
package/dist/abi/ring.js CHANGED
@@ -286,6 +286,19 @@ export async function settleWaits(timeoutMs = 200) {
286
286
  await Promise.race([Promise.all(all.map((w) => w.settled)), new Promise((r) => (timer = setTimeout(r, timeoutMs)))]);
287
287
  clearTimeout(timer);
288
288
  }
289
+ /**
290
+ * Settles the waits that sleeps on this ring left (a notify on its words), for a ring done with. A
291
+ * waitAsync outlives its sleep (see waitWord), and on a ring nobody writes again it stays pending:
292
+ * it kept the ring's memory, with its waiter, for as long as the thread lived (T334: the FS Worker
293
+ * kept each ended host process's rings, 4 MiB, until Chromium had no room for an ArrayBuffer).
294
+ * Sleeps on the ring wake.
295
+ */
296
+ export function releaseWaits(ring) {
297
+ const [words] = ring.waitTarget();
298
+ for (const w of pending)
299
+ if (w.words === words)
300
+ Atomics.notify(w.words, w.index);
301
+ }
289
302
  /**
290
303
  * Sleeps until the word changes from `value`, a notify, the signal aborts, or the watchdog fires.
291
304
  * Never blocks the thread.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpodjs/net-worker",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Net Worker for webpod: the guest's gateway (webpod-net NetStack), browser egress and page connections",
5
5
  "keywords": [
6
6
  "webpod",