Skip to content

Commit 20aee5c

Browse files
committed
wip: fixed up benchmark
[ci skip]
1 parent cefe4ac commit 20aee5c

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

benches/stream_1KB.ts

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ async function main() {
1616
),
1717
]);
1818
// Setting up initial state
19-
const crypto = {
20-
key: await testsUtils.generateKey(),
21-
ops: {
22-
sign: testsUtils.sign,
23-
verify: testsUtils.verify,
24-
randomBytes: testsUtils.randomBytes,
25-
},
26-
};
27-
2819
const data1KiB = Buffer.alloc(1024, 0xf0);
2920
const host = '127.0.0.1' as Host;
3021
const certChainPem = await fs.promises.readFile(
@@ -36,14 +27,18 @@ async function main() {
3627

3728
const quicServer = new QUICServer({
3829
config: {
39-
tlsConfig: {
40-
privKeyPem: privKeyPem.toString(),
41-
certChainPem: certChainPem.toString(),
42-
},
30+
key: privKeyPem.toString(),
31+
cert: certChainPem.toString(),
4332
verifyPeer: false,
33+
keepAliveIntervalTime: 1000,
34+
},
35+
crypto: {
36+
key: await testsUtils.generateKeyHMAC(),
37+
ops: {
38+
sign: testsUtils.signHMAC,
39+
verify: testsUtils.verifyHMAC,
40+
},
4441
},
45-
keepaliveIntervalTime: 1000,
46-
crypto,
4742
logger,
4843
});
4944
quicServer.addEventListener(
@@ -80,7 +75,11 @@ async function main() {
8075
host,
8176
port: quicServer.port,
8277
localHost: host,
83-
crypto,
78+
crypto: {
79+
ops: {
80+
randomBytes: testsUtils.randomBytes,
81+
},
82+
},
8483
logger,
8584
});
8685

src/QUICServer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import QUICSocket from './QUICSocket';
2525
import { never } from './utils';
2626

2727
/**
28-
* You must provide a error handler `addEventListener('error')`.
29-
* Otherwise errors will just be ignored.
28+
* You must provide an error handler `addEventListener('error')`.
29+
* Otherwise, errors will just be ignored.
3030
*
3131
* Events:
3232
* - serverStop
@@ -221,7 +221,7 @@ class QUICServer extends EventTarget {
221221
errorMessage: 'cleaning up connections',
222222
force,
223223
}),
224-
); // TODO: fill in with proper details
224+
);
225225
}
226226
this.logger.debug('Awaiting connections to destroy');
227227
await Promise.all(destroyProms);

0 commit comments

Comments
 (0)