mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-29 12:50:59 +00:00
move try-catch outside of loop in TLS readstream
This commit is contained in:
@@ -62,18 +62,18 @@ export class PTLSSocket extends PSocket {
|
||||
let reader = read.getReader();
|
||||
let done = false;
|
||||
this.emit("tlsopen", undefined);
|
||||
|
||||
while (!done) {
|
||||
try {
|
||||
try {
|
||||
while (!done) {
|
||||
const {done: readerDone, value} = await reader.read();
|
||||
done = readerDone;
|
||||
if (!done) {
|
||||
this.emit("tlsdata", value);
|
||||
}
|
||||
} catch (e) {
|
||||
this.emit("error", e)
|
||||
}
|
||||
} catch (e) {
|
||||
this.emit("error", e)
|
||||
}
|
||||
this.emit("close", undefined);
|
||||
})();
|
||||
}
|
||||
on(event, callback) {
|
||||
|
||||
Reference in New Issue
Block a user