| Commit message (Collapse) | Author | Age |
|
|
|
| |
Closes #3364
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current name is inappropriate for the following reasons:
1. It is often masked by local `loop` variables.
2. It cannot be searched for. There are many `loop` variables where `loop` is
some local variable. There are many cases when “loop” word is used in
a comment.
3. It is in any case bad idea to use a generic name as a name of the global
variable. Best if global has module prefix: this is why it is in `main.h`:
`main_loop` both stands for “a main loop” and “a loop defined in `main.*`”.
Since I have no idea how to list every occurrence of this variable method used
to rename it is “remove it from globals.h, try to compile, fix errors”. Thus if
some occurrence was hidden under false `#if` branch it was not replaced.
|
| |
|
| |
|
|
|
|
|
|
| |
Return 1 if the endpoint argument is NULL, server_start() can get
a NULL value when using server_address_new() or vim_tempname(). Removed
the function attribute.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When creating a local socket/pipe (server_start()) Neovim used vim_tempname() to
generate a unique socket path. For Windows UNIX filepaths cannot be used as
pipe names (they must start with \\.\pipe\). This commit replaces the use of
vim_tempname() for server addresses with server_address_new().
server_address_new() generates unique names for local sockets/pipes - for UNIX
it uses vim_tempname(), for Windows generates names in the form
\\.\pipe\nvim-PID-COUNTER
where PID is the current process id, and COUNTER is a static uint32_t counter
incremented with every call. This function is now used for server_start() and
server_init() when no address is available.
|
|
|
|
|
|
| |
- Move event loop code into event/socket
- Reimplement server.c on top of the new SocketWatcher class
- Adapt msgpack_rpc/channel.c
|
|
|
|
|
|
|
|
|
|
| |
- Add event loop abstraction module under src/nvim/event. The
src/nvim/event/loop module replaces src/nvim/os/event
- Remove direct dependency on libuv signal/timer API and use the new abstraction
instead.
- Replace all references to uv_default_loop() by &loop.uv, a new global variable
that wraps libuv main event loop but allows the event loop functions to be
reused in other contexts.
|
|
|
|
|
|
| |
Making an environment variable empty can be a way of unsetting it for
platforms that don't support unsetenv(). In most cases, we treat empty
variables as having been unset. For all others, use os_env_exists().
|
| |
|
|
|
|
|
|
|
| |
- On startup, v:servername is equivalent to $NVIM_LISTEN_ADDRESS
- v:servername may be considered the "default" server address
- v:servername does not change unless the associated server is stopped
by serverstop()
|
|
|
|
|
|
|
|
|
| |
suspicious_sizeof: Passing argument 8UL /* sizeof (char const **) */ to
function xcalloc and then casting the return value to char ** is
suspicious.
In this particular case sizeof (char const **) happens to be
equal to sizeof (char const *), but this is not a portable as
|
|
|
|
|
|
| |
Reviewed-by: Eliseo Martínez <eliseomarmol@gmail.com>
Reviewed-by: Marco Hinz <mh.codebro@gmail.com>
Reviewed-by: Björn Linse <bjorn.linse@gmail.com>
|
|
|
|
|
|
| |
Implement functions for spawning, destroying, and listing active
servers, and add server_address_list() to msgpack_rpc/server.c for the
serverlist() vimL function.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Testing of server_start() and server_stop() found that after adding a
server at address addr, pmap_has(addr) would always return true, but
pmap_get(addr) would always return NULL.
Since a client is only expected to have a small number of servers, an
array may be more efficient than a hash map, anyway.
Discussion:
https://github.com/neovim/neovim/pull/1302#issuecomment-88487148
|
|
|
|
|
|
| |
We already use wrappers for allocation, the new `xfree` function is the
equivalent for deallocation and provides a way to fully replace the malloc
implementation used by Neovim.
|
|
|
|
|
|
|
|
| |
If the server fails to start(due to used address for example), the
`server_start` function was freeing the handle memory before it was properly
removed from libuv event loop queue. Fix that by replacing the `free(server)`
call by `uv_close` call, which will take care of freeing the server on the next
event loop iteration. Also replace `EMSG` calls by `ELOG`/`WLOG`.
|
|
|
|
|
|
| |
All files under the os, api and msgpack_rpc directories have -Wconversion
automatically applied. CONV_SOURCES is also checked for missing files(when
renaming, for example)
|
|
Create the msgpack_rpc subdirectory and move all modules that deal with
msgpack-rpc to it. Also merge msgpack_rpc.c into msgpack_rpc/helpers.c
|