diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2017-05-04 17:59:51 +0200 |
---|---|---|
committer | Marco Hinz <mh.codebro@gmail.com> | 2017-05-22 01:05:39 +0200 |
commit | 3efc82cbb28a1fd6f1c10a4fc91e8ce749ad384f (patch) | |
tree | 089b9956711508cb2d7fafc585254606b7cc4172 /src/nvim/eval.c | |
parent | 9cc10c69f2533a71c0e352b534d0b09567e51668 (diff) | |
download | rneovim-3efc82cbb28a1fd6f1c10a4fc91e8ce749ad384f.tar.gz rneovim-3efc82cbb28a1fd6f1c10a4fc91e8ce749ad384f.tar.bz2 rneovim-3efc82cbb28a1fd6f1c10a4fc91e8ce749ad384f.zip |
Server: use uv_getaddrinfo() for $NVIM_LISTEN_ADDRESS
This change implicitly adds IPv6 support.
If the address contains ":", we try to use a TCP socket instead of a Unix domain
socket. Everything in front of the last occurrence of ":" is the hostname and
everything after it the port.
If the hostname lookup fails, we fall back to using a Unix domain socket.
If the port is empty ("localhost:"), a random port will be assigned.
Examples:
NVIM_LISTEN_ADDRESS=localhost:12345 -> TCP (IPv4 or IPv6), port: 12345
NVIM_LISTEN_ADDRESS=localhost: -> TCP (IPv4 or IPv6), port: random (> 1024)
NVIM_LISTEN_ADDRESS=localhost:0 -> TCP (IPv4 or IPv6), port: random (> 1024)
NVIM_LISTEN_ADDRESS=localhost -> Unix domain socket "localhost" in current dir
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index e4b3128930..e2e95ee69e 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -14310,7 +14310,8 @@ static void f_serverstart(typval_T *argvars, typval_T *rettv, FunPtr fptr) int result = server_start((char *) rettv->vval.v_string); if (result != 0) { - EMSG2("Failed to start server: %s", uv_strerror(result)); + EMSG2("Failed to start server: %s", + result > 0 ? "Unknonwn system error" : uv_strerror(result)); } } |