Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
fix: update interfaces (#168)
Browse files Browse the repository at this point in the history
Update to the latest interfaces version
  • Loading branch information
achingbrain authored May 4, 2022
1 parent 1bd5ae6 commit f592f96
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@
"it-pushable": "^2.0.1",
"it-stream-types": "^1.0.4",
"uint8arraylist": "^1.4.0",
"uint8arrays": "^3.0.0",
"varint": "^6.0.0"
},
"devDependencies": {
"@libp2p/interface-compliance-tests": "^1.1.21",
"@libp2p/interfaces": "^1.3.20",
"@libp2p/interface-compliance-tests": "^1.1.32",
"@libp2p/interfaces": "^1.3.31",
"@types/varint": "^6.0.0",
"aegir": "^37.0.10",
"cborg": "^1.8.1",
Expand All @@ -163,7 +164,6 @@
"it-foreach": "^0.1.1",
"it-map": "^1.0.6",
"p-defer": "^4.0.0",
"random-int": "^3.0.0",
"uint8arrays": "^3.0.0"
"random-int": "^3.0.0"
}
}
10 changes: 8 additions & 2 deletions src/mplex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { abortableSource } from 'abortable-iterator'
import { encode } from './encode.js'
import { decode } from './decode.js'
import { restrictSize } from './restrict-size.js'
import { MessageTypes, MessageTypeNames, Message } from './message-types.js'
import { MessageTypes, MessageTypeNames, Message, ReceiverMessageTypes, InitiatorMessageTypes } from './message-types.js'
import { createStream } from './stream.js'
import { toString as uint8ArrayToString } from 'uint8arrays'
import { trackedMap } from '@libp2p/tracked-map'
Expand Down Expand Up @@ -233,7 +233,13 @@ export class MplexStreamMuxer implements StreamMuxer {
const stream = list.get(id)

if (stream == null) {
return log('missing stream %s', id)
log('missing stream %s', id)

// send a reset
this._source.push({ id, type: InitiatorMessageTypes.RESET })
this._source.push({ id, type: ReceiverMessageTypes.RESET })

return
}

switch (type) {
Expand Down

0 comments on commit f592f96

Please sign in to comment.