Skip to content

Commit 073446b

Browse files
committed
legacy_http -> stdlib_http
1 parent f72511a commit 073446b

5 files changed

Lines changed: 11 additions & 12 deletions

File tree

src/options.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class SenderOptions {
160160
log?: Logger;
161161
agent?: Agent | http.Agent | https.Agent;
162162

163-
legacy_http?: boolean;
163+
stdlib_http?: boolean;
164164

165165
auth?: {
166166
username?: string;
@@ -286,7 +286,7 @@ function parseConfigurationString(
286286
parseTlsOptions(options);
287287
parseRequestTimeoutOptions(options);
288288
parseMaxNameLength(options);
289-
parseLegacyTransport(options);
289+
parseStdlibTransport(options);
290290
}
291291

292292
function parseSettings(
@@ -348,8 +348,8 @@ const ValidConfigKeys = [
348348
"init_buf_size",
349349
"max_buf_size",
350350
"max_name_len",
351+
"stdlib_http",
351352
"tls_verify",
352-
"legacy_http",
353353
"tls_ca",
354354
"tls_roots",
355355
"tls_roots_password",
@@ -472,8 +472,8 @@ function parseMaxNameLength(options: SenderOptions) {
472472
parseInteger(options, "max_name_len", "max name length", 1);
473473
}
474474

475-
function parseLegacyTransport(options: SenderOptions) {
476-
parseBoolean(options, "legacy_http", "legacy http");
475+
function parseStdlibTransport(options: SenderOptions) {
476+
parseBoolean(options, "stdlib_http", "stdlib http");
477477
}
478478

479479
function parseBoolean(

src/transport/http/base.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ abstract class HttpTransportBase implements SenderTransport {
116116
* HTTP transport does not require explicit connection closure.
117117
* @returns Promise that resolves immediately
118118
*/
119-
async close(): Promise<void> {
120-
}
119+
async close(): Promise<void> {}
121120

122121
/**
123122
* Gets the default auto-flush row count for HTTP transport.

src/transport/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Buffer } from "node:buffer";
44
import { SenderOptions, HTTP, HTTPS, TCP, TCPS } from "../options";
55
import { UndiciTransport } from "./http/undici";
66
import { TcpTransport } from "./tcp";
7-
import { HttpTransport } from "./http/legacy";
7+
import { HttpTransport } from "./http/stdlib";
88

99
/**
1010
* Interface for QuestDB transport implementations. <br>
@@ -56,7 +56,7 @@ function createTransport(options: SenderOptions): SenderTransport {
5656
switch (options.protocol) {
5757
case HTTP:
5858
case HTTPS:
59-
return options.legacy_http
59+
return options.stdlib_http
6060
? new HttpTransport(options)
6161
: new UndiciTransport(options);
6262
case TCP:

test/sender.transport.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import http from "http";
77
import { Sender } from "../src";
88
import { SenderOptions } from "../src/options";
99
import { UndiciTransport } from "../src/transport/http/undici";
10-
import { HttpTransport } from "../src/transport/http/legacy";
10+
import { HttpTransport } from "../src/transport/http/stdlib";
1111
import { MockProxy } from "./util/mockproxy";
1212
import { MockHttp } from "./util/mockhttp";
1313

@@ -278,12 +278,12 @@ describe("Sender HTTP suite", function () {
278278
await agent.destroy();
279279
});
280280

281-
it("supports custom legacy HTTP agent", async function () {
281+
it("supports custom stdlib HTTP agent", async function () {
282282
mockHttp.reset();
283283
const agent = new http.Agent({ maxSockets: 128 });
284284

285285
const sender = Sender.fromConfig(
286-
`http::addr=${PROXY_HOST}:${MOCK_HTTP_PORT};legacy_http=on`,
286+
`http::addr=${PROXY_HOST}:${MOCK_HTTP_PORT};stdlib_http=on`,
287287
{ agent: agent },
288288
);
289289
await sendData(sender);

0 commit comments

Comments
 (0)