@amritk/nish-x86_64-linux 0.23.0 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/nish CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amritk/nish-x86_64-linux",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "The nish native compiler for Linux on x86_64",
5
5
  "license": "MIT",
6
6
  "os": [
@@ -1334,18 +1334,24 @@ export class Http1Connection {
1334
1334
  }
1335
1335
 
1336
1336
  /**
1337
- * The soonest `expired` can turn true, however the connection moves from
1338
- * here: `lastActive` only grows, and a head clock not yet started starts
1339
- * no earlier than it.
1337
+ * The soonest `expired` can turn true at or after `now` (`monotonicNanos`),
1338
+ * however the connection moves from here: `lastActive` only grows, and a
1339
+ * head clock not yet started starts no earlier than `now`, unless an
1340
+ * exchange is open: `nextRequest` starts a pipelined head's clock at
1341
+ * `lastActive` when it ends. Counting a quiet keep-alive's clock from
1342
+ * `lastActive` put it in the past once it was quiet for longer than
1343
+ * `headTimeout`, so each `expire` walked every slot.
1340
1344
  */
1341
- expiresNoSooner(): i64 {
1342
- const idle: i64 = toI64(this.config.idleTimeout) * toI64(1000000)
1343
- const head: i64 = toI64(this.config.headTimeout) * toI64(1000000)
1344
- const soonest: i64 = this.lastActive + (head < idle ? head : idle)
1345
- if (this.headTimed && this.headSince + head < soonest) {
1346
- return this.headSince + head
1345
+ expiresNoSooner(now: i64): i64 {
1346
+ const idle: i64 = this.lastActive + toI64(this.config.idleTimeout) * toI64(1000000)
1347
+ let start: i64 = now
1348
+ if (this.headTimed) {
1349
+ start = this.headSince
1350
+ } else if (this.requestOpen) {
1351
+ start = this.lastActive
1347
1352
  }
1348
- return soonest
1353
+ const head: i64 = start + toI64(this.config.headTimeout) * toI64(1000000)
1354
+ return head < idle ? head : idle
1349
1355
  }
1350
1356
  }
1351
1357
 
@@ -1679,8 +1685,8 @@ export class Http1Server {
1679
1685
  if (conn.expired(now)) {
1680
1686
  this.close(k)
1681
1687
  n = n + 1
1682
- } else if (conn.expiresNoSooner() < soonest) {
1683
- soonest = conn.expiresNoSooner()
1688
+ } else if (conn.expiresNoSooner(now) < soonest) {
1689
+ soonest = conn.expiresNoSooner(now)
1684
1690
  }
1685
1691
  }
1686
1692
  }
@@ -1982,8 +1988,8 @@ export class Http1TlsServer {
1982
1988
  if (conn.expired(now)) {
1983
1989
  this.tls.close(k)
1984
1990
  n = n + 1
1985
- } else if (conn.expiresNoSooner() < soonest) {
1986
- soonest = conn.expiresNoSooner()
1991
+ } else if (conn.expiresNoSooner(now) < soonest) {
1992
+ soonest = conn.expiresNoSooner(now)
1987
1993
  }
1988
1994
  }
1989
1995
  }