winfix: better pipe support

This commit is contained in:
AJ ONeal 2018-07-02 20:30:18 -06:00
parent d52b4e7594
commit b9fae99ddc
2 changed files with 8 additions and 4 deletions

View File

@ -571,11 +571,13 @@ function serveControlsHelper() {
// mask is so that processes owned by other users
// can speak to this process, which is probably root-owned
var oldUmask = process.umask(0x0000);
require('mkdirp').sync(path.resolve(state._ipc.path, '..'));
if ('socket' === state._ipc.type) {
require('mkdirp').sync(path.dirname(state._ipc.path));
}
controlServer.listen({
path: state._ipc.path
path: state._ipc.path || null
, host: 'localhost'
//, port: 0
, port: state._ipc.port || null
, writableAll: true
, readableAll: true
, exclusive: false

View File

@ -81,7 +81,9 @@ common.pipename = function (config) {
, type: (/^win/i.test(os.platform()) ? 'pipe' : 'socket')
};
if ('pipe' === _ipc.type) {
_ipc.path = '\\\\?\\pipe' + _ipc.path.replace(/\//, '\\');
// https://docs.microsoft.com/en-us/windows/desktop/ipc/pipe-names
// Allows all characters accept backslash as part of the name
_ipc.path = '\\\\.\\pipe\\' + _ipc.path.replace(/\\/g, '/');
}
return _ipc;
};