Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
fix: once in all
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Jan 10, 2017
1 parent 9cd021b commit ffff12c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dialer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Dialer {
*/
select (protocol, callback) {
this.log('dialer select ' + protocol)
callback = once(callback)
if (!this.conn) {
return callback(new Error('multistream handshake has not finalized yet'))
}
Expand Down Expand Up @@ -95,6 +96,8 @@ class Dialer {
* @returns {undefined}
*/
ls (callback) {
callback = once(callback)

const lsStream = select('ls', (err, conn) => {
if (err) {
return callback(err)
Expand Down

0 comments on commit ffff12c

Please sign in to comment.