@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.
@@ -6176,7 +6176,7 @@ function satisfies(version, range2) {
6176
6176
  }
6177
6177
 
6178
6178
  // src/version.ts
6179
- var KERNEL_VERSION = true ? "1.110.4" : "0.0.0-dev";
6179
+ var KERNEL_VERSION = true ? "1.110.5" : "0.0.0-dev";
6180
6180
  var OS_RELEASE = "6.0.0-slicc";
6181
6181
  function procVersion() {
6182
6182
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -5212,7 +5212,7 @@ var KERNEL_VERSION, OS_RELEASE;
5212
5212
  var init_version = __esm({
5213
5213
  "src/version.ts"() {
5214
5214
  "use strict";
5215
- KERNEL_VERSION = true ? "1.110.4" : "0.0.0-dev";
5215
+ KERNEL_VERSION = true ? "1.110.5" : "0.0.0-dev";
5216
5216
  OS_RELEASE = "6.0.0-slicc";
5217
5217
  }
5218
5218
  });
@@ -6484,12 +6484,13 @@ function fetchOp(kernel) {
6484
6484
  throw signal.aborted ? signal.reason : failed(err);
6485
6485
  }
6486
6486
  };
6487
- const body = (handle, signal) => {
6487
+ const body = (handle, request) => {
6488
+ const { signal } = request;
6488
6489
  let aborted;
6489
6490
  const settle = () => {
6490
6491
  if (aborted) signal.removeEventListener("abort", aborted);
6491
6492
  };
6492
- return new ReadableStream(
6493
+ const stream = new ReadableStream(
6493
6494
  {
6494
6495
  start(controller) {
6495
6496
  aborted = () => {
@@ -6524,8 +6525,10 @@ function fetchOp(kernel) {
6524
6525
  },
6525
6526
  { highWaterMark: 0 }
6526
6527
  );
6528
+ keptRequests.set(stream, request);
6529
+ return stream;
6527
6530
  };
6528
- const respond = (head, method, redirected, encoded, signal) => {
6531
+ const respond = (head, method, redirected, encoded, request) => {
6529
6532
  if (head.status < 200 || head.status > 599) {
6530
6533
  void close(head.handle);
6531
6534
  throw failed(new JsCallError("EPROTO", `status ${head.status}`));
@@ -6533,7 +6536,7 @@ function fetchOp(kernel) {
6533
6536
  const empty = method === "HEAD" || NULL_BODY.has(head.status);
6534
6537
  if (empty) void close(head.handle);
6535
6538
  const headers = new Headers(head.headers);
6536
- let stream = empty ? null : body(head.handle, signal);
6539
+ let stream = empty ? null : body(head.handle, request);
6537
6540
  const coding = headers.get("content-encoding")?.trim().toLowerCase();
6538
6541
  if (stream && encoded && coding && DECODED.has(coding)) {
6539
6542
  const format = coding === "deflate" ? "deflate" : "gzip";
@@ -6541,6 +6544,7 @@ function fetchOp(kernel) {
6541
6544
  new DecompressionStream(format)
6542
6545
  );
6543
6546
  headers.delete("content-length");
6547
+ keptRequests.set(stream, request);
6544
6548
  }
6545
6549
  const response = new Response(stream, {
6546
6550
  status: head.status,
@@ -6586,7 +6590,7 @@ function fetchOp(kernel) {
6586
6590
  const follow2 = known.manualRedirects && REDIRECTS.has(head.status) && location !== void 0 && request.redirect !== "manual";
6587
6591
  if (!follow2) {
6588
6592
  const redirected = hops > 0 || head.redirected === true;
6589
- return respond(head, hop.method, redirected, known.encodedBodies, signal);
6593
+ return respond(head, hop.method, redirected, known.encodedBodies, request);
6590
6594
  }
6591
6595
  await close(head.handle);
6592
6596
  if (request.redirect === "error") throw failed(new Error("unexpected redirect"));
@@ -6595,7 +6599,7 @@ function fetchOp(kernel) {
6595
6599
  }
6596
6600
  };
6597
6601
  }
6598
- var CHUNK2, MAX_REDIRECTS, NULL_BODY, REDIRECTS, BODY_HEADERS, DECODED, CREDENTIALS, BAD_PORTS, OVER, TOKEN, QUOTABLE, SPACE, BASE64, SLICE;
6602
+ var CHUNK2, MAX_REDIRECTS, keptRequests, NULL_BODY, REDIRECTS, BODY_HEADERS, DECODED, CREDENTIALS, BAD_PORTS, OVER, TOKEN, QUOTABLE, SPACE, BASE64, SLICE;
6599
6603
  var init_js_fetch = __esm({
6600
6604
  "src/process/js/js-fetch.ts"() {
6601
6605
  "use strict";
@@ -6603,6 +6607,7 @@ var init_js_fetch = __esm({
6603
6607
  init_js_kernel();
6604
6608
  CHUNK2 = 64 * 1024;
6605
6609
  MAX_REDIRECTS = 20;
6610
+ keptRequests = /* @__PURE__ */ new WeakMap();
6606
6611
  NULL_BODY = /* @__PURE__ */ new Set([101, 103, 204, 205, 304]);
6607
6612
  REDIRECTS = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
6608
6613
  BODY_HEADERS = /* @__PURE__ */ new Set([