git ssb

0+

cel-desktop / ssb-pkg



Commit c5c7a8ffadbd51aa28a5f3f096fe43f69405da44

Prevent looping on retry after ECONNREFUSED

cel committed on 7/10/2020, 6:56:30 PM
Parent: d456a6cc8589489e558e6164750474ed2cfc961e

Files changed

prelude/install.jschanged
prelude/install.jsView
@@ -47,9 +47,11 @@
4747 })
4848 }
4949 this.req = http.get(url, onResp).on('error', (err) => {
5050 // sometimes localhost resolves to 127.0.0.1 but ssb-ws listens on ::1
51- if (err.code === 'ECONNREFUSED' && err.address === '127.0.0.1') {
51 + if (err.code === 'ECONNREFUSED' && err.address === '127.0.0.1'
52 + && this.blobsBase.indexOf('localhost') > -1
53 + ) {
5254 this.blobsBase = this.blobsBase.replace('localhost', '[::1]')
5355 url = this.blobsBase + id
5456 http.get(url, onResp).on('error', (err) => {
5557 this.destroy(err)

Built with git-ssb-web