@ai-ecoverse/slicc-kernel 1.110.4 → 1.110.5

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/dist/node.js CHANGED
@@ -6494,7 +6494,7 @@ function satisfies(version, range2) {
6494
6494
  }
6495
6495
 
6496
6496
  // src/version.ts
6497
- var KERNEL_VERSION = true ? "1.110.4" : "0.0.0-dev";
6497
+ var KERNEL_VERSION = true ? "1.110.5" : "0.0.0-dev";
6498
6498
  var OS_RELEASE = "6.0.0-slicc";
6499
6499
  function procVersion() {
6500
6500
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -2515,7 +2515,7 @@ var KERNEL_VERSION, OS_RELEASE;
2515
2515
  var init_version = __esm({
2516
2516
  "src/version.ts"() {
2517
2517
  "use strict";
2518
- KERNEL_VERSION = true ? "1.110.4" : "0.0.0-dev";
2518
+ KERNEL_VERSION = true ? "1.110.5" : "0.0.0-dev";
2519
2519
  OS_RELEASE = "6.0.0-slicc";
2520
2520
  }
2521
2521
  });
@@ -14494,12 +14494,13 @@ function fetchOp(kernel) {
14494
14494
  throw signal.aborted ? signal.reason : failed3(err);
14495
14495
  }
14496
14496
  };
14497
- const body = (handle, signal) => {
14497
+ const body = (handle, request) => {
14498
+ const { signal } = request;
14498
14499
  let aborted;
14499
14500
  const settle = () => {
14500
14501
  if (aborted) signal.removeEventListener("abort", aborted);
14501
14502
  };
14502
- return new ReadableStream(
14503
+ const stream = new ReadableStream(
14503
14504
  {
14504
14505
  start(controller) {
14505
14506
  aborted = () => {
@@ -14534,8 +14535,10 @@ function fetchOp(kernel) {
14534
14535
  },
14535
14536
  { highWaterMark: 0 }
14536
14537
  );
14538
+ keptRequests.set(stream, request);
14539
+ return stream;
14537
14540
  };
14538
- const respond = (head, method, redirected, encoded, signal) => {
14541
+ const respond = (head, method, redirected, encoded, request) => {
14539
14542
  if (head.status < 200 || head.status > 599) {
14540
14543
  void close(head.handle);
14541
14544
  throw failed3(new JsCallError("EPROTO", `status ${head.status}`));
@@ -14543,7 +14546,7 @@ function fetchOp(kernel) {
14543
14546
  const empty = method === "HEAD" || NULL_BODY.has(head.status);
14544
14547
  if (empty) void close(head.handle);
14545
14548
  const headers = new Headers(head.headers);
14546
- let stream = empty ? null : body(head.handle, signal);
14549
+ let stream = empty ? null : body(head.handle, request);
14547
14550
  const coding = headers.get("content-encoding")?.trim().toLowerCase();
14548
14551
  if (stream && encoded && coding && DECODED.has(coding)) {
14549
14552
  const format = coding === "deflate" ? "deflate" : "gzip";
@@ -14551,6 +14554,7 @@ function fetchOp(kernel) {
14551
14554
  new DecompressionStream(format)
14552
14555
  );
14553
14556
  headers.delete("content-length");
14557
+ keptRequests.set(stream, request);
14554
14558
  }
14555
14559
  const response = new Response(stream, {
14556
14560
  status: head.status,
@@ -14596,7 +14600,7 @@ function fetchOp(kernel) {
14596
14600
  const follow2 = known.manualRedirects && REDIRECTS.has(head.status) && location !== void 0 && request.redirect !== "manual";
14597
14601
  if (!follow2) {
14598
14602
  const redirected = hops > 0 || head.redirected === true;
14599
- return respond(head, hop.method, redirected, known.encodedBodies, signal);
14603
+ return respond(head, hop.method, redirected, known.encodedBodies, request);
14600
14604
  }
14601
14605
  await close(head.handle);
14602
14606
  if (request.redirect === "error") throw failed3(new Error("unexpected redirect"));
@@ -14605,7 +14609,7 @@ function fetchOp(kernel) {
14605
14609
  }
14606
14610
  };
14607
14611
  }
14608
- var CHUNK2, MAX_REDIRECTS, NULL_BODY, REDIRECTS, BODY_HEADERS, DECODED, CREDENTIALS, BAD_PORTS, OVER, TOKEN, QUOTABLE, SPACE, BASE64, SLICE;
14612
+ var CHUNK2, MAX_REDIRECTS, keptRequests, NULL_BODY, REDIRECTS, BODY_HEADERS, DECODED, CREDENTIALS, BAD_PORTS, OVER, TOKEN, QUOTABLE, SPACE, BASE64, SLICE;
14609
14613
  var init_js_fetch = __esm({
14610
14614
  "src/process/js/js-fetch.ts"() {
14611
14615
  "use strict";
@@ -14613,6 +14617,7 @@ var init_js_fetch = __esm({
14613
14617
  init_js_kernel();
14614
14618
  CHUNK2 = 64 * 1024;
14615
14619
  MAX_REDIRECTS = 20;
14620
+ keptRequests = /* @__PURE__ */ new WeakMap();
14616
14621
  NULL_BODY = /* @__PURE__ */ new Set([101, 103, 204, 205, 304]);
14617
14622
  REDIRECTS = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
14618
14623
  BODY_HEADERS = /* @__PURE__ */ new Set([