@ai-ecoverse/slicc-kernel 1.159.2 → 1.159.4
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 +3 -2
- package/dist/kernel-worker.js +13 -10
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-driver-worker.js.map +2 -2
- package/dist/node-process-worker.js +3 -1
- package/dist/node-process-worker.js.map +2 -2
- package/dist/node.js +13 -10
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +1 -1
- package/dist/types/kernel/socket.d.ts +1 -0
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -2001,41 +2001,42 @@ var KernelSocket = class _KernelSocket {
|
|
|
2001
2001
|
}
|
|
2002
2002
|
async read(max, signal) {
|
|
2003
2003
|
const { rx } = this.connection();
|
|
2004
|
-
|
|
2004
|
+
this.drained(rx);
|
|
2005
2005
|
if (this.readShut || max <= 0) return new Uint8Array(0);
|
|
2006
2006
|
const bytes = await pipeCall(() => rx.read(max, signal));
|
|
2007
|
-
if (
|
|
2007
|
+
if (bytes.length === 0) this.drained(rx);
|
|
2008
2008
|
if (bytes.length === 0 && this.reset) throw this.reset;
|
|
2009
2009
|
return bytes;
|
|
2010
2010
|
}
|
|
2011
2011
|
async peek(max, signal) {
|
|
2012
2012
|
const { rx } = this.connection();
|
|
2013
|
-
|
|
2013
|
+
this.drained(rx);
|
|
2014
2014
|
if (this.readShut || max <= 0) return new Uint8Array(0);
|
|
2015
2015
|
const bytes = await pipeCall(() => rx.peek(max, signal));
|
|
2016
|
-
if (
|
|
2016
|
+
if (bytes.length === 0) this.drained(rx);
|
|
2017
2017
|
if (bytes.length === 0 && this.reset) throw this.reset;
|
|
2018
2018
|
return bytes;
|
|
2019
2019
|
}
|
|
2020
|
+
drained(rx) {
|
|
2021
|
+
if (this.refused && rx.buffered === 0) throw this.refused;
|
|
2022
|
+
}
|
|
2020
2023
|
rightsLink() {
|
|
2021
2024
|
const link2 = this.connection();
|
|
2022
2025
|
if (this.domain !== "unix" || this.switch || this.served) throw new KernelError("EOPNOTSUPP");
|
|
2023
|
-
if (this.refused) throw this.refused;
|
|
2024
2026
|
return link2;
|
|
2025
2027
|
}
|
|
2026
2028
|
sendRights(bytes, mark, nonblock, signal) {
|
|
2027
2029
|
const { tx } = this.rightsLink();
|
|
2030
|
+
if (this.refused) throw this.refused;
|
|
2028
2031
|
if (this.writeShut) throw new KernelError("EPIPE");
|
|
2029
2032
|
return pipeCall(() => tx.writeMarked(bytes, (at) => mark(at, tx.inFlight), nonblock, signal));
|
|
2030
2033
|
}
|
|
2031
2034
|
async receiveRights(max, nonblock, signal) {
|
|
2032
2035
|
const { rx } = this.rightsLink();
|
|
2036
|
+
this.drained(rx);
|
|
2033
2037
|
if (this.readShut || max <= 0) return { bytes: EMPTY, marks: [] };
|
|
2034
2038
|
const got = await pipeCall(() => rx.receive(max, nonblock, signal));
|
|
2035
|
-
if (this.
|
|
2036
|
-
for (const mark of got.marks) mark.drop();
|
|
2037
|
-
throw this.refused;
|
|
2038
|
-
}
|
|
2039
|
+
if (got.bytes.length === 0) this.drained(rx);
|
|
2039
2040
|
return got;
|
|
2040
2041
|
}
|
|
2041
2042
|
get secured() {
|
|
@@ -2204,6 +2205,8 @@ var KernelSocket = class _KernelSocket {
|
|
|
2204
2205
|
remoteAddr: "",
|
|
2205
2206
|
read: async () => {
|
|
2206
2207
|
const bytes = await raw2.rx.read(SERVE_CHUNK, handshaking ? signal : void 0).catch(() => EMPTY);
|
|
2208
|
+
if (bytes.length === 0 && this.refused)
|
|
2209
|
+
throw new KernelError("ECONNRESET", "read ECONNRESET");
|
|
2207
2210
|
return bytes.length > 0 ? bytes : null;
|
|
2208
2211
|
},
|
|
2209
2212
|
write: (bytes) => raw2.tx.write(bytes),
|
|
@@ -3669,7 +3672,7 @@ function satisfies(version, range2) {
|
|
|
3669
3672
|
}
|
|
3670
3673
|
|
|
3671
3674
|
// src/version.ts
|
|
3672
|
-
var KERNEL_VERSION = true ? "1.159.
|
|
3675
|
+
var KERNEL_VERSION = true ? "1.159.4" : "0.0.0-dev";
|
|
3673
3676
|
var OS_RELEASE = "6.0.0-slicc";
|
|
3674
3677
|
function procVersion() {
|
|
3675
3678
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|