Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 77a8f8f

Browse files
committed
feat: pinpoint
1 parent 64080b4 commit 77a8f8f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/core/components/ping-pull-stream.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ module.exports = function pingPullStream (self) {
2222
getPeer(self._libp2pNode, source, peerId, (err, peer) => {
2323
if (err) {
2424
log.error(err)
25-
source.push(err)
26-
source.end()
25+
source.end(err)
2726
return
2827
}
2928

src/http/api/resources/ping.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ exports.get = {
4343
const responseStream = toStream.source(source)
4444
const stream2 = new PassThrough()
4545
pump(responseStream, stream2)
46+
// TODO: here lies the issue
47+
// The fact that ping can fail after it starts writting some success ndjson
48+
// responses is not very friendly to how Hapi expects this stream to work
4649
reply(stream2).type('application/json').header('X-Chunked-Output', '1')
4750
}
4851
}

0 commit comments

Comments
 (0)