Comparing version 3.1.1 to 3.1.2
@@ -34,2 +34,3 @@ /** | ||
this.authorizeWriteFn = opts.authorizeWrite | ||
this.needInit | ||
this.sentEdit | ||
@@ -66,2 +67,3 @@ this.queue | ||
Link.prototype.send = function(event/*, args..*/) { | ||
if('requestInit' === event) this.needInit = true | ||
var data = JSON.stringify(Array.prototype.slice.call(arguments)) | ||
@@ -136,3 +138,4 @@ this.authorizeRead(Array.prototype.slice.apply(arguments), function(er, authorized) { | ||
this.send('authenticate', this.credentials) | ||
this.send('requestInit') | ||
if(this.needInit) this.send('requestInit') | ||
else this.send('edit', this.sentEdit.pack()) // this is a reconnect! | ||
this.sentCredentials = true | ||
@@ -143,2 +146,8 @@ cb() | ||
// Allow reconnecting: Once we receive data from the other end | ||
// sentCredentials will be false again, to allow sending an authenticate msg | ||
this.sentCredentials = false | ||
if(args[0] === 'init') this.needInit = false | ||
this.authorizeWrite(args, function(er, authorized) { | ||
@@ -145,0 +154,0 @@ |
{ | ||
"name": "gulf", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "transport-agnostic operational transformation control layer", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92423
1287