Fix interaction of --tcp and --port
This commit is contained in:
parent
219b0716c0
commit
eab78141c4
|
@ -40,7 +40,7 @@ int main(string[] args)
|
|||
|
||||
size_t cursorPos = size_t.max;
|
||||
string[] importPaths;
|
||||
ushort port = 9166;
|
||||
ushort port;
|
||||
bool help;
|
||||
bool shutdown;
|
||||
bool clearCache;
|
||||
|
@ -102,6 +102,14 @@ int main(string[] args)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// If the user specified a port number, assume that they wanted a TCP
|
||||
// connection. Otherwise set the port number to the default and let the
|
||||
// useTCP flag deterimen what to do later.
|
||||
if (port != 0)
|
||||
useTCP = true;
|
||||
else
|
||||
port = DEFAULT_PORT_NUMBER;
|
||||
|
||||
if (useTCP)
|
||||
socketFile = null;
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ version (linux) version = haveUnixSockets;
|
|||
version (BSD) version = haveUnixSockets;
|
||||
version (FreeBSD) version = haveUnixSockets;
|
||||
|
||||
enum DEFAULT_PORT_NUMBER = 9166;
|
||||
|
||||
string generateSocketName()
|
||||
{
|
||||
version (haveUnixSockets)
|
||||
|
|
|
@ -56,7 +56,7 @@ version(OSX) version = useXDG;
|
|||
|
||||
int main(string[] args)
|
||||
{
|
||||
ushort port = 9166;
|
||||
ushort port;
|
||||
bool help;
|
||||
bool printVersion;
|
||||
bool ignoreConfig;
|
||||
|
@ -107,6 +107,17 @@ int main(string[] args)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// If the user specified a port number, assume that they wanted a TCP
|
||||
// connection. Otherwise set the port number to the default and let the
|
||||
// useTCP flag deterimen what to do later.
|
||||
if (port != 0)
|
||||
useTCP = true;
|
||||
else
|
||||
port = DEFAULT_PORT_NUMBER;
|
||||
|
||||
if (useTCP)
|
||||
socketFile = null;
|
||||
|
||||
version (Windows) if (socketFile !is null)
|
||||
{
|
||||
fatal("UNIX domain sockets not supported on Windows");
|
||||
|
|
Loading…
Reference in New Issue