Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var ws = require( 'ws' ),
source,
socket,
SyncMessage = require( './syncmessage' ),
rsync = require('../../lib/rsync'),
Buffer = require('filer').Buffer,
uri,
rsyncOptions = require('../../lib/constants').rsyncDefaults,
deserializeDiff = require('../../lib/diff').deserialize;
var states = {
CONN_CLOSED: -1,
ERROR: 0,
CONN_OPEN: 1,
CHKSUM: 2,
CHKSUM_ACK: 3
};
var syncState;
module.exports = {
init: function( options, initial, callback ) {