hypercore 10.37.6 → 10.37.8
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/lib/replicator.js +8 -1
- package/package.json +1 -1
package/lib/replicator.js
CHANGED
|
@@ -457,7 +457,7 @@ class Peer {
|
|
|
457
457
|
const name = message.name || this.lastExtensionRecv
|
|
458
458
|
this.lastExtensionRecv = name
|
|
459
459
|
const ext = this.extensions.get(name)
|
|
460
|
-
if (ext) ext._onmessage({ start: 0, end: message.byteLength, buffer: message.message }, this)
|
|
460
|
+
if (ext) ext._onmessage({ start: 0, end: message.message.byteLength, buffer: message.message }, this)
|
|
461
461
|
}
|
|
462
462
|
|
|
463
463
|
sendSync () {
|
|
@@ -759,7 +759,10 @@ class Peer {
|
|
|
759
759
|
|
|
760
760
|
this.inflight--
|
|
761
761
|
this.replicator._requestDone(req.id, false)
|
|
762
|
+
|
|
763
|
+
// clear inflight state
|
|
762
764
|
if (isBlockRequest(req)) this.replicator._unmarkInflight(req.block.index)
|
|
765
|
+
if (isUpgradeRequest(req)) this.replicator._clearInflightUpgrade(req)
|
|
763
766
|
|
|
764
767
|
if (this.roundtripQueue === null) this.roundtripQueue = new RoundtripQueue()
|
|
765
768
|
this.roundtripQueue.add(req.id)
|
|
@@ -2412,3 +2415,7 @@ function setDownloadingLater (repl, downloading, session) {
|
|
|
2412
2415
|
function isBlockRequest (req) {
|
|
2413
2416
|
return req !== null && req.block !== null
|
|
2414
2417
|
}
|
|
2418
|
+
|
|
2419
|
+
function isUpgradeRequest (req) {
|
|
2420
|
+
return req !== null && req.upgrade !== null
|
|
2421
|
+
}
|