From be8c90de6fed4ff7f70289633787606f495c7cb9 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Tue, 24 Sep 2024 20:28:50 +0900 Subject: [PATCH] fmt --- ext/node/polyfills/_http_outgoing.ts | 23 ++++++++------ ext/node/polyfills/http.ts | 46 +++++++++++++++------------- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/ext/node/polyfills/_http_outgoing.ts b/ext/node/polyfills/_http_outgoing.ts index 96addb163d..1f1f49b48f 100644 --- a/ext/node/polyfills/_http_outgoing.ts +++ b/ext/node/polyfills/_http_outgoing.ts @@ -497,15 +497,15 @@ Object.defineProperties( const socket = this.socket; const outputLength = this.outputData.length; if (socket && outputLength > 0) { - const { data, encoding, callback } = this.outputData.shift(); - console.log("flushBody: writing", { data }); - this._writeRaw(data, encoding, callback); - if (this.outputData.length > 0) { - this.on("drain", () => { - console.log("drain emitted"); - this._flushBody(); - }); - } + const { data, encoding, callback } = this.outputData.shift(); + console.log("flushBody: writing", { data }); + this._writeRaw(data, encoding, callback); + if (this.outputData.length > 0) { + this.on("drain", () => { + console.log("drain emitted"); + this._flushBody(); + }); + } } }, @@ -514,7 +514,10 @@ Object.defineProperties( _flushHeaders() { console.log("flushHeaders"); if (this.socket) { - console.log("socket found: ", { headerSent: this._headerSent, header: this._header }); + console.log("socket found: ", { + headerSent: this._headerSent, + header: this._header, + }); if (!this._headerSent) { console.log("_writeHeader invoked"); this._writeHeader(); diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index 693706344e..455496aefb 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -617,15 +617,15 @@ class ClientRequest extends OutgoingMessage { // Flush the internal buffers once socket is ready. // Note: the order is important, as the headers flush // sets up the request. - try { - this._flushHeaders(); - this.on("requestReady", () => { - console.log("onSocket: flushing body"); - this._flushBody(); - }); - } catch (error) { - console.log("socket error: ", error); - } + try { + this._flushHeaders(); + this.on("requestReady", () => { + console.log("onSocket: flushing body"); + this._flushBody(); + }); + } catch (error) { + console.log("socket error: ", error); + } }); this.socket = socket; this.emit("socket", socket); @@ -801,19 +801,21 @@ class ClientRequest extends OutgoingMessage { path = "/" + path; } console.log("_createUrlStrFromOptions 9"); -// try { - console.log({ url: `${protocol}//${auth ? `${auth}@` : ""}${host}${ - port === 80 ? "" : `:${port}` - }${path}` }) - const url = new URL( - `${protocol}//${auth ? `${auth}@` : ""}${host}${ - port === 80 ? "" : `:${port}` - }${path}`, - ); - console.log(url); -// } catch (error) { - // console.log({ error }) -// } + // try { + console.log({ + url: `${protocol}//${auth ? `${auth}@` : ""}${host}${ + port === 80 ? "" : `:${port}` + }${path}`, + }); + const url = new URL( + `${protocol}//${auth ? `${auth}@` : ""}${host}${ + port === 80 ? "" : `:${port}` + }${path}`, + ); + console.log(url); + // } catch (error) { + // console.log({ error }) + // } console.log("_createUrlStrFromOptions 10"); url.hash = hash; console.log("_createUrlStrFromOptions end");