Commit 0c7a4a8666e22690eb45952c1f96f70936f261e6
oops, was never calling has callback, which broke images
Dominic Tarr committed on 4/10/2017, 9:49:38 PMParent: 796634e94c93bda5d25791822b9963855f108960
Files changed
inject.js | changed |
inject.js | |||
---|---|---|---|
@@ -244,13 +244,16 @@ | |||
244 | 244 … | } | |
245 | 245 … | else if(!isBlobId(hash)) | |
246 | 246 … | return cb(new Error('invalid hash:'+hash)) | |
247 | 247 … | ||
248 | - if(this === self || !this || this === global) { // a local call | ||
249 | - return blobs.has.call(this, hash, cb) | ||
248 … | + if(!legacy) { | ||
249 … | + blobs.has.call(this, hash, cb) | ||
250 | 250 … | } | |
251 … | + else { | ||
251 | 252 … | //LEGACY LEGACY LEGACY | |
252 | - if(!legacy) return | ||
253 … | + if(this === self || !this || this === global) { // a local call | ||
254 … | + return blobs.has.call(this, hash, cb) | ||
255 … | + } | ||
253 | 256 … | //ELSE, interpret remote calls to has as a WANT request. | |
254 | 257 … | //handling this by calling process (which calls size()) | |
255 | 258 … | //avoids a race condition in the tests. | |
256 | 259 … | //(and avoids doubling the number of calls) | |
@@ -261,11 +264,10 @@ | |||
261 | 264 … | process(o, null, function (err, res) { | |
262 | 265 … | var a = []; for(var k in o) a.push(res[k] > 0) | |
263 | 266 … | cb(null, Array.isArray(hash) ? a : a[0]) | |
264 | 267 … | }) | |
265 | - | ||
266 | 268 … | //LEGACY LEGACY LEGACY | |
267 | - | ||
269 … | + } | ||
268 | 270 … | }, | |
269 | 271 … | size: blobs.size, | |
270 | 272 … | get: blobs.get, | |
271 | 273 … | add: blobs.add, | |
@@ -329,4 +331,7 @@ | |||
329 | 331 … | } | |
330 | 332 … | } | |
331 | 333 … | } | |
332 | 334 … | ||
335 … | + | ||
336 … | + | ||
337 … | + |
Built with git-ssb-web