Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/QUICClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,13 @@ class QUICClient {
await crypto.ops.randomBytes(scidBuffer);
const scid = new QUICConnectionId(scidBuffer);
// Validating host and port types
let [host_, udpType] = await utils.resolveHost(host, resolveHostname);
const [tmpHost, udpType] = await utils.resolveHost(host, resolveHostname);
const port_ = utils.toPort(port);
// If the target host is in fact a zero IP, it cannot be used
// as a target host, so we need to resolve it to a non-zero IP
// in this case, 0.0.0.0 is resolved to 127.0.0.1 and :: and ::0 is
// resolved to ::1.
let host_ = tmpHost;
host_ = utils.resolvesZeroIP(host_);
let isSocketShared: boolean;
if (socket == null) {
Expand Down
6 changes: 5 additions & 1 deletion src/QUICSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,11 @@ class QUICSocket {
);
}
const host = params[index] as Host | Hostname;
let [host_, udpType] = await utils.resolveHost(host, this.resolveHostname);
const [tmpHost, udpType] = await utils.resolveHost(
host,
this.resolveHostname,
);
let host_ = tmpHost;
host_ = utils.resolvesZeroIP(host_);
host_ = utils.validateTarget(
this._host,
Expand Down
2 changes: 1 addition & 1 deletion src/QUICStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ class QUICStream implements ReadableWritablePair<Uint8Array, Uint8Array> {
this.rejectReadableP = rejectReadableP;
try {
await readableP;
} catch (e) {
} catch {
// If readableP was rejected then we just want to end early here,
// anything rejecting it should already have errored the stream.
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/QUICStream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as utils from '#utils.js';
import QUICServer from '#QUICServer.js';
import QUICClient from '#QUICClient.js';
import QUICStream from '#QUICStream.js';
1;

describe(QUICStream.name, () => {
const logger = new Logger(`${QUICStream.name} Test`, LogLevel.WARN, [
new StreamHandler(
Expand Down