diff --git a/src/idz/index.ts b/src/idz/index.ts index 2ce2f49..77ef67b 100644 --- a/src/idz/index.ts +++ b/src/idz/index.ts @@ -15,8 +15,10 @@ export default async function idz(socket: Socket) { output.write(await dispatch(world, req)); } } catch (e) { - console.log("Idz: Error", e); + console.log("Idz: Error:", e); } console.log("Idz: Connection closed\n"); + + input.end(); } diff --git a/src/idz/setup.ts b/src/idz/setup.ts index cd5233f..bf023c6 100644 --- a/src/idz/setup.ts +++ b/src/idz/setup.ts @@ -35,12 +35,16 @@ console.log("RSA ENCDEC :", byteString(test2, 0x40).toString("hex")); // -- TEST -- interface Session { - input: AsyncIterable; + input: AsyncIterable & { + end: () => void; + }; output: { write: (res: Response) => void; }; } +function doNothing() {} + export function setup(socket: Socket): Session { // // Construct and transmit setup message @@ -67,13 +71,13 @@ export function setup(socket: Socket): Session { socket, createDecipheriv("aes-128-ecb", keybuf, null).setAutoPadding(false), input - ); + ).catch(doNothing); pipeline( output, createCipheriv("aes-128-ecb", keybuf, null).setAutoPadding(false), socket - ); + ).catch(doNothing); return { input, output }; }