remove console.logs from server.ts

This commit is contained in:
Spencer Pogorzelski 2023-08-14 21:01:29 -07:00
parent 4e31a2a4e7
commit eae44fef4b

View file

@ -45,7 +45,6 @@ export class AdriftServer {
msg: ArrayBuffer msg: ArrayBuffer
): { cursor: number; seq: number; op: number } | undefined { ): { cursor: number; seq: number; op: number } | undefined {
try { try {
console.log(msg);
const dataView = new DataView(msg); const dataView = new DataView(msg);
let cursor = 0; let cursor = 0;
const seq = dataView.getUint16(cursor); const seq = dataView.getUint16(cursor);
@ -72,7 +71,6 @@ export class AdriftServer {
} }
throw e; throw e;
} }
console.log({ payload });
return payload; return payload;
} }
@ -224,7 +222,6 @@ export class AdriftServer {
resp = await this.handleHTTPRequest(seq, reqPayload); resp = await this.handleHTTPRequest(seq, reqPayload);
} catch (e) { } catch (e) {
// drop the upload if we are sending an error document // drop the upload if we are sending an error document
console.log("error drop");
delete this.requestStreams[seq]; delete this.requestStreams[seq];
if (options.logErrors) console.error(e); if (options.logErrors) console.error(e);
@ -265,7 +262,6 @@ export class AdriftServer {
this.sendHTTPResponseEnd(seq); this.sendHTTPResponseEnd(seq);
// if the body upload *still* isn't done by the time the response is done // if the body upload *still* isn't done by the time the response is done
// downloading, kill it. // downloading, kill it.
console.log("final drop");
delete this.requestStreams[seq]; delete this.requestStreams[seq];
break; break;
} }
@ -278,10 +274,8 @@ export class AdriftServer {
} }
case C2SRequestTypes.HTTPRequestEnd: { case C2SRequestTypes.HTTPRequestEnd: {
console.log("req end");
const stream = this.requestStreams[seq]; const stream = this.requestStreams[seq];
if (!stream) return; if (!stream) return;
console.log("req end drop");
(await stream).end(); (await stream).end();
delete this.requestStreams[seq]; delete this.requestStreams[seq];
break; break;