git ssb

7+

dinoworm 🐛 / patchcore



Commit 1fac221a92fbdaf25995c5519565812349b9df29

Merge branch 'master' into patch-router

mix irving committed on 8/7/2017, 4:38:55 AM
Parent: 23cb22e8f3709df0332639004c5a655ace3fc07a
Parent: 34c4a94f3baa311c5602618ea2ff80e6245b7c62

Files changed

package.jsonchanged
sbot.jschanged
package.jsonView
@@ -1,7 +1,7 @@
11 {
22 "name": "patchcore",
3- "version": "1.8.1",
3 + "version": "1.8.2",
44 "description": "minimal core for ssb clients",
55 "main": "index.js",
66 "scripts": {
77 "start": "electro example",
@@ -48,9 +48,9 @@
4848 "pull-stream": "^3.5.0",
4949 "simple-mime": "^0.1.0",
5050 "sorted-array-functions": "^1.0.0",
5151 "split-buffer": "^1.0.0",
52- "ssb-client": "^4.4.0",
52 + "ssb-client": "^4.5.0",
5353 "ssb-config": "^2.2.0",
5454 "ssb-feed": "^2.3.0",
5555 "ssb-keys": "^7.0.9",
5656 "ssb-markdown": "^3.3.0",
sbot.jsView
@@ -173,26 +173,9 @@
173173 }),
174174 addBlob: rec.async((stream, cb) => {
175175 return pull(
176176 stream,
177- Hash(function (err, id) {
178- if (err) return cb(err)
179- // completely UGLY hack to tell when the blob has been sucessfully written...
180- var start = Date.now()
181- var n = 5
182- next()
183-
184- function next () {
185- setTimeout(function () {
186- sbot.blobs.has(id, function (_, has) {
187- if (has) return cb(null, id)
188- if (n--) next()
189- else cb(new Error('write failed'))
190- })
191- }, Date.now() - start)
192- }
193- }),
194- sbot.blobs.add()
177 + sbot.blobs.add(cb)
195178 )
196179 }),
197180 gossipConnect: rec.async(function (opts, cb) {
198181 sbot.gossip.connect(opts, cb)
@@ -250,19 +233,4 @@
250233 // api.sbot.hook.feed(msg)
251234 }
252235 }
253236 }
254-
255-function Hash (onHash) {
256- var buffers = []
257- return pull.through(function (data) {
258- buffers.push(typeof data === 'string'
259- ? new Buffer(data, 'utf8')
260- : data
261- )
262- }, function (err) {
263- if (err && !onHash) throw err
264- var b = buffers.length > 1 ? Buffer.concat(buffers) : buffers[0]
265- var h = '&' + ssbKeys.hash(b)
266- onHash && onHash(err, h)
267- })
268-}

Built with git-ssb-web