Fixed server exception.

This commit is contained in:
Ylian Saint-Hilaire 2021-03-01 12:38:13 -08:00
parent 97d5e5352d
commit ce44fcb2eb
1 changed files with 3 additions and 3 deletions

View File

@ -3989,7 +3989,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
// Perform an async file open // Perform an async file open
var callback = function onFileOpen(err, fd) { var callback = function onFileOpen(err, fd) {
onFileOpen.xws.xfile = fd; onFileOpen.xws.xfile = fd;
onFileOpen.xws.send(JSON.stringify({ action: 'download', sub: 'startack', id: onFileOpen.xws.xid, ack: 1 })); // Ask for a directory (test) try { onFileOpen.xws.send(JSON.stringify({ action: 'download', sub: 'startack', id: onFileOpen.xws.xid, ack: 1 })); } catch (ex) { } // Ask for a directory (test)
}; };
callback.xws = this; callback.xws = this;
obj.fs.open(this.xfilepath + '.part', 'w', callback); obj.fs.open(this.xfilepath + '.part', 'w', callback);
@ -4013,11 +4013,11 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
obj.fs.rename(onFileDataWritten.xws.xfilepath + '.part', onFileDataWritten.xws.xfilepath, function (err) { }); obj.fs.rename(onFileDataWritten.xws.xfilepath + '.part', onFileDataWritten.xws.xfilepath, function (err) { });
onFileDataWritten.xws.xfile = null; onFileDataWritten.xws.xfile = null;
} }
onFileDataWritten.xws.send(JSON.stringify({ action: 'markcoredump' })); // Ask to delete the core dump file try { onFileDataWritten.xws.send(JSON.stringify({ action: 'markcoredump' })); } catch (ex) { } // Ask to delete the core dump file
try { onFileDataWritten.xws.close(); } catch (ex) { } try { onFileDataWritten.xws.close(); } catch (ex) { }
} else { } else {
// Send ack // Send ack
onFileDataWritten.xws.send(JSON.stringify({ action: 'download', sub: 'ack', id: onFileDataWritten.xws.xid })); // Ask for a directory (test) try { onFileDataWritten.xws.send(JSON.stringify({ action: 'download', sub: 'ack', id: onFileDataWritten.xws.xid })); } catch (ex) { } // Ask for a directory (test)
} }
}; };
callback.xws = this; callback.xws = this;