From 2bf061607e6f327055bf51056fe449445f44d302 Mon Sep 17 00:00:00 2001 From: krishna Date: Tue, 23 Aug 2016 20:30:55 +0530 Subject: [PATCH 1/3] fix/ffi_proccess_crash: resolve ffi process termination fixes #235 --- app/scripts/main.js | 2 ++ app/ui_utils.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scripts/main.js b/app/scripts/main.js index 18e59a59..b32ab5e7 100644 --- a/app/scripts/main.js +++ b/app/scripts/main.js @@ -43,6 +43,8 @@ window.safeLauncher = angular eventRegistry.logList = []; $rootScope.intervals = []; $rootScope.retryCount = 1; + $rootScope.userInfo = {}; + $rootScope.user = {}; }; $rootScope.resetStats = function() { diff --git a/app/ui_utils.js b/app/ui_utils.js index 18242bf9..1051d6d9 100644 --- a/app/ui_utils.js +++ b/app/ui_utils.js @@ -174,7 +174,7 @@ export default class UIUtils { reconnect(user) { var self = this; this.api.reset(); - if (user) { + if (user && Object.keys(user).length !== 0) { this.api.auth.login(user.accountSecret, user.accountPassword, function(err) { if (!self.onNetworkStateChange) { return; From 41b30a5f706264b2fd2958f76c209c570459cdfb Mon Sep 17 00:00:00 2001 From: krishna Date: Tue, 23 Aug 2016 20:32:57 +0530 Subject: [PATCH 2/3] fix/empty_file_creation: resolve empty file creation in nfs fixes #241 --- app/server/controllers/nfs.js | 3 +++ app/server/stream/nfs_writer.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/app/server/controllers/nfs.js b/app/server/controllers/nfs.js index 350bbec4..87d96a5a 100644 --- a/app/server/controllers/nfs.js +++ b/app/server/controllers/nfs.js @@ -189,6 +189,9 @@ export var createFile = function(req, res, next) { return responseHandler(err); } var writer = new NfsWriter(req, writerId, responseHandler, length); + if (length === 0) { + writer.closeWriter(); + } req.on('aborted', function() { next(new ResponseError(400, 'Request aborted by client')); }); diff --git a/app/server/stream/nfs_writer.js b/app/server/stream/nfs_writer.js index c44783b0..237b1a7c 100644 --- a/app/server/stream/nfs_writer.js +++ b/app/server/stream/nfs_writer.js @@ -33,3 +33,8 @@ NfsWriter.prototype._write = function(data, enc, next) { }); }; /*jscs:enable disallowDanglingUnderscores*/ + + +NfsWriter.prototype.closeWriter = function() { + this.req.app.get('api').nfs.closeWriter(this.writerId, this.responseHandler); +}; From ffbe18a253051b0ec6435bcf0f955ce8bcce100d Mon Sep 17 00:00:00 2001 From: krishna Date: Tue, 23 Aug 2016 20:33:41 +0530 Subject: [PATCH 3/3] fix/fetch_file_metadata: resolve fetching file with metadata via dns fixes #234 --- app/server/controllers/dns.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/server/controllers/dns.js b/app/server/controllers/dns.js index d9be6fc1..c151f41e 100644 --- a/app/server/controllers/dns.js +++ b/app/server/controllers/dns.js @@ -122,7 +122,7 @@ export var getFile = function(req, res, next) { 'Content-Type': mime.lookup(filePath) || 'application/octet-stream' }; if (fileStats.metadata && fileStats.metadata.length > 0) { - headers.metadata = new Buffer(fileStats.metadata, 'base64').tostring('base64'); + headers.metadata = new Buffer(fileStats.metadata, 'base64').toString('base64'); } res.writeHead(range ? 206 : 200, headers); if (chunksize === 0) {