mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Gun - mesh. Putting the dam message first solve the problem of the first gun 'in' event come without peer.id.
This commit is contained in:
parent
51b98ba370
commit
6d12b3d5a9
2
gun.js
2
gun.js
@ -2027,7 +2027,7 @@
|
||||
if(peer.batch){
|
||||
peer.tail = (peer.tail || 0) + raw.length;
|
||||
if(peer.tail <= opt.pack){
|
||||
peer.batch.push(raw);
|
||||
(msg.dam) ? peer.batch.unshift(raw) : peer.batch.push(raw);
|
||||
return;
|
||||
}
|
||||
flush(peer);
|
||||
|
@ -101,7 +101,7 @@ function Mesh(ctx){
|
||||
if(peer.batch){
|
||||
peer.tail = (peer.tail || 0) + raw.length;
|
||||
if(peer.tail <= opt.pack){
|
||||
peer.batch.push(raw);
|
||||
(msg.dam) ? peer.batch.unshift(raw) : peer.batch.push(raw);
|
||||
return;
|
||||
}
|
||||
flush(peer);
|
||||
@ -230,4 +230,4 @@ Mesh.hash = function(s){ // via SO
|
||||
|
||||
try{ module.exports = Mesh }catch(e){}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user