diff --git a/gun.js b/gun.js index 57bfd68b..597b276a 100644 --- a/gun.js +++ b/gun.js @@ -313,7 +313,6 @@ emit(last, act, event); } if(last !== act.on.last){ - //console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>", last, act.on.last); event(act); } }); @@ -1060,7 +1059,7 @@ if(cat.map){ // TODO: map will exist but different than if something in it. tmp = false; obj_map(cat.map, function(coat){ - console.log("CRASH3"); + //console.log("CRASH3"); tmp = true; coat.on('in', coat); //cat.on('in').last.emit(coat); @@ -1559,6 +1558,10 @@ return; } if(HAM.defer){ // TODO: BUG! Not implemented. + union[field] = value; // WRONG! BUG! Need to implement correct algorithm. + state_ify(union, field, is); // WRONG! BUG! Need to implement correct algorithm. + // filler algorithm for now. + return; /*upper.wait = true; opt.upper.call(state, vertex, field, incoming, ctx.incoming.state); // signals that there are still future modifications. Gun.schedule(ctx.incoming.state, function(){ @@ -2371,7 +2374,7 @@ function request (peers, ctx) { if (Client.isSupported) { - Client.broadcast(peers, { body: ctx }); + Client.broadcast(peers, ctx); } } @@ -2380,12 +2383,13 @@ this.to.next(ctx); var gun = ctx.gun; var peers = gun.back('opt.peers') || {}; + var headers = gun.back('opt.headers') || {}; // Validate. if (Gun.obj.empty(peers)) { return; } - request(peers, ctx); + request(peers, {body: ctx, headers: headers}); }); request.jsonp = function (opt, cb) { diff --git a/lib/wsp/client.js b/lib/wsp/client.js index d410f931..3cdb3850 100644 --- a/lib/wsp/client.js +++ b/lib/wsp/client.js @@ -50,6 +50,7 @@ Gun.on('out', function (ctx) { var gun = ctx.gun; var opt = ctx.opt || {}; var peers = opt.peers || gun.back('opt.peers'); + var headers = opt.headers || gun.back('opt.headers') || {}; if (!peers) { return; @@ -57,8 +58,9 @@ Gun.on('out', function (ctx) { var subset = getSocketSubset(peers); + headers['gun-sid'] = sid; subset.send({ - headers: { 'gun-sid': sid }, + headers: headers, body: ctx, }); });