8e77cd37 by Jabis Sevón

Merge remote-tracking branch 'origin/master'

2 parents 99644135 4fd4d8d6
;(function(){
var Gun = (typeof window !== "undefined")? window.Gun : require('gun');
var Gun = (typeof window !== "undefined")? window.Gun : require("gun/gun");
var url = require('url');
Gun.on('opt', function mount(ctx){
......
(function() {
var Gun = typeof window !== "undefined" ? window.Gun : require("gun");
var Gun = typeof window !== "undefined" ? window.Gun : require("gun/gun");
Gun.on("opt", function(ctx) {
this.to.next(ctx);
......@@ -29,6 +29,24 @@
to = setTimeout(flush, opt.wait || 1);
});
ctx.on("put", function(at) {
this.to.next(at);
Gun.graph.is(at.put, null, null);
if (!at["@"]) {
acks[at["#"]] = true;
} // only ack non-acks.
count += 1;
if (count >= (opt.batch || 10000)) {
return flush();
}
if (to) {
return;
}
to = setTimeout(flush, opt.wait || 1);
var id = at['#']
ctx.on('in', {"@": id, ok:1})
});
ctx.on("get", function(at) {
// this.to.next(at); //What does this do?
var lex = at.get,
......
......@@ -51,7 +51,7 @@ server.on("upgrade", async function(request, socket, head) {
gun.gun = new Gun({
peers: [], // should we use self as peer?
localStorage: false,
file: false, // "tmp/" + pathname,
file: false,
radisk: false,
multicast: false,
ws: { noServer: true, path: pathname, web: gun.server },
......@@ -67,6 +67,7 @@ server.on("upgrade", async function(request, socket, head) {
gun.server.emit("connection", ws, request);
});
} else {
if (debug) console.log("destroying socket", pathname);
socket.destroy();
}
});
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!