From 9f5a5ab394771a4b39956e2630d9adee880fbae0 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Fri, 16 May 2014 12:25:08 -0500 Subject: [PATCH 1/2] Fix bad signature of ClientRequest#setNoDelay `noDelay` argument should be boolean, not Function --- node/node.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node.d.ts b/node/node.d.ts index d8bd39b28..2bd63497d 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -327,7 +327,7 @@ declare module "http" { write(chunk: any, encoding?: string): void; abort(): void; setTimeout(timeout: number, callback?: Function): void; - setNoDelay(noDelay?: Function): void; + setNoDelay(noDelay?: boolean): void; setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; // Extended base methods From 1789164e95816a92761f0f12b7d1662ed73f5191 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Fri, 16 May 2014 12:46:14 -0500 Subject: [PATCH 2/2] Add test of ClientRequest#setNoDelay interface Uses an invalid address as request address to avoid actual HTTP requests (since it is not necessary to make a real request to test this interface). --- node/node-tests.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node/node-tests.ts b/node/node-tests.ts index 5598bac17..51edd42a7 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -95,3 +95,8 @@ var hmacResult: string = crypto.createHmac('md5', 'hello').update('world').diges // Make sure .listen() and .close() retuern a Server instance http.createServer().listen(0).close().address(); net.createServer().listen(0).close().address(); + +var request = http.request('http://0.0.0.0'); +request.once('error', function () {}); +request.setNoDelay(true); +request.abort();