aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc
Commit message (Collapse)AuthorAge
...
* remote_ui: Fix error messages #2045Carlos Castillo2015-03-04
| | | | Make the error messages more precise and uniform.
* job: Refactor process spawning and startup argumentsThiago de Arruda2015-02-23
| | | | | | | | - process spawning was decoupled from the rest of the job control logic. The goal is reusing it for spawning processes connected to pseudo terminal file descriptors. - job_start now receives a JobOptions structure containing all the startup options.
* refactor: Remove term modules and termcap optionsThiago de Arruda2015-02-21
| | | | | | | | | | | | | | | - Removed term.c, term.h and term_defs.h - Tests for T_* values were removed. screen.c was simplified as a consequence(the best strategy for drawing is implemented in the UI layer) - Redraw functions now call ui.c functions directly. Updates are flushed with `ui_flush()` - Removed all termcap options(they now return empty strings for compatibility) - &term/&ttybuiltin options return a constant value(nvim) - &t_Co is still available, but it mirrors t_colors directly - Remove cursor tracking from screen.c and the `screen_start` function. Now the UI is expected to maintain cursor state across any call, and reset it when resized. - Remove unused code
* ui: Remove/adapt some old code for a big UI refactorThiago de Arruda2015-02-16
| | | | | | | | | | | | | - Remove abstract_ui global, now it is always active - Remove some terminal handling code - Remove unused functions - Remove HAVE_TGETENT/TERMINFO/TERMIOS/IOCTL #ifdefs - Remove tgetent/terminfo from version.c - Remove curses/terminfo dependencies - Only start/stop termcap when starting/exiting the program - msg_use_printf will return true if there are no attached UIs( messages will be written to stdout) - Remove `ex_winpos`(implement `:winpos` with `ex_ni`)
* coverity/{68484,68485}: Read from pointer after free: RI.Thiago de Arruda2015-02-11
| | | | | | | | | Problem : Read from pointer after free @ {242, 391}. Diagnostic : Real issues. Rationale : Channel gets indeed freed on error case, producing incorrect accesses to freed pointer later on. Resolution : Implement reference counting mechanism to know when to free channel.
* build: upgrade msgpack-c #1900Michael Reed2015-02-09
| | | | | | | closes #1899 closes #1967 refs https://github.com/msgpack/msgpack-c/pull/194
* Fix CID #102150Jack Danger Canty2015-01-22
| | | | | | | Don't attempt to write an error message to a channel that may have been closed and freed. [CID #102150](https://scan8.coverity.com/reports.htm#v22612/p10672/fileInstanceId=3625286&defectInstanceId=1525721&mergedDefectId=102150)
* ui: Implement set_{title,icon}Thiago de Arruda2015-01-14
|
* channel: Make pending_requests a field of the Channel typeThiago de Arruda2015-01-13
| | | | | This is required to send redraw notifications while a msgpack-rpc call is being performed by another channel.
* ui: Fix `:suspend` command for remote UIsThiago de Arruda2015-01-13
| | | | | Forward the command to the remote UI and flush immediately. The semantics/handling is UI-specific.
* channel: Free channels created from libuv streamsThiago de Arruda2015-01-13
|
* ui: Add 'rgb' parameter to ui_attachThiago de Arruda2015-01-13
| | | | When set to false, nvim will send cterm color numbers with `highlight_set`.
* ui: Merge standout and reverse into one attributeThiago de Arruda2015-01-13
|
* ui: Fix ui resizing and change some method namesThiago de Arruda2015-01-13
|
* remote_ui: Move handler registration to remote_ui.cThiago de Arruda2015-01-13
| | | | Also disable deferral of attach_ui
* ui: Add update_fg/update_bg methodsThiago de Arruda2015-01-13
| | | | | It is necessary to notify the UI when the default background/foreground colors change in order to render correctly.
* Revert "[WIP] "abstract_ui" fixes and improvements"Justin M. Keyes2015-01-12
|
* channel: Make pending_requests a field of the Channel typeThiago de Arruda2015-01-12
| | | | | This is required to send redraw notifications while a msgpack-rpc call is being performed by another channel.
* ui: Reimplement `:suspend` command for remote UIs.Thiago de Arruda2015-01-12
| | | | | | - Remove suspend method from the UI protocol - Handle `:suspend` by disconnecting the last channel that sent a request to nvim.
* channel: Free channels created from libuv streamsThiago de Arruda2015-01-12
|
* ui: Add 'rgb' parameter to ui_attachThiago de Arruda2015-01-12
| | | | When set to false, nvim will send cterm color numbers with `highlight_set`.
* ui: Merge standout and reverse into one attributeThiago de Arruda2015-01-12
|
* ui: Fix ui resizing and change some method namesThiago de Arruda2015-01-12
|
* remote_ui: Move handler registration to remote_ui.cThiago de Arruda2015-01-10
| | | | Also don't defer attach_ui handling
* ui: Add update_fg/update_bg methodsThiago de Arruda2015-01-10
| | | | | It is necessary to notify the UI when the default background/foreground colors change in order to render correctly.
* msgpack-rpc: Add remote_ui moduleThiago de Arruda2014-12-08
| | | | | The remote_ui module is an implementation of the UI layer, and it attaches UI instances that redirect redraw notifications to connected clients.
* msgpack-rpc: Allow registration of handlers by other modulesThiago de Arruda2014-12-08
|
* channel.c: Fix for heap-use-after-freeoni-link2014-12-03
| | | | | | | | | ASAN detected this heap-use-after-free. A job started by channel_from_job() could terminate and result in a call to free_channel(), while channel_send_call() was still active/pending and accessing Channel elements. Original patch by @tarruda.
* Fix memory leak detected in PR 1510.oni-link2014-12-03
| | | | | LSAN/ASAN detected, on an error code path, that not all elements of a struct ChannelCallFrame were freed.
* channel: Improve error reporting for invalid responsesThiago de Arruda2014-11-18
|
* channel: Remove invalid free_channel callThiago de Arruda2014-11-18
| | | | | When a job fails to start, it will already call the exit_cb which takes care of freeing the channel.
* Mark some function arguments as [consumed] in the docs.oni-link2014-11-09
| | | | | The argument argv of job_start() and channel_from_job() will be freed. Mark them as such in the comments of this functions.
* msgpack-rpc: Close channel on invalid msgpack RPCRui Abreu Ferreira2014-11-07
| | | | | | - When an invalid msgpack RPC msg is received from a channel we now close that channel all calls on that channel fail with an error message.
* msgpack-rpc: Don't try to write into a closed channelRui Abreu Ferreira2014-11-07
|
* msgpack-rpc: Fix typo in validation messageRui Abreu Ferreira2014-11-07
|
* msgpack-rpc: Return from msgpack_rpc_validate on errorRui Abreu Ferreira2014-11-07
| | | | | - When validating a msgpack msg we need to return on the first error otherwise we can SEGFAULT with invalid checks
* channel: Delay notifications to avoid client race conditionsThiago de Arruda2014-11-06
| | | | | | | | | | It is currently possible for a client to send a response that doesn't match the current server->client request(at the top of the stack). This commit fixes that by delaying notifications to until the first `channel_send_call` invocation returns. Also remove the "call stack" size check, vim will already break if the call stack goes too deep.
* channel: Move mch_exit(0) call to a non-deferred event handlerThiago de Arruda2014-11-03
| | | | | Since `mch_exit` will re-enter event_poll, it is necessary to call it outside libuv event loop.
* event: Reintroduce the immediate event queueThiago de Arruda2014-11-02
| | | | | | | | | | | | | Commit @264e0d872c("Remove automatic event deferral") removed the immediate event queue because event deferral now had to be explicit. The problem is that while some events don't need to be deferred, they still can result in recursive `event_poll` calls, and recursion is not supported by libuv. Examples of those are msgpack-rpc requests while a server->client request is pending, or signals which can call `mch_exit`(and that will result in `uv_run` calls). To fix the problem, this reintroduces the immediate event queue for events that can potentially result in event loop recursion. The non-deferred events are still processed in `event_poll`, but only after `uv_run` returns.
* server: Refactor to ensure server handles are always properly closedThiago de Arruda2014-11-02
| | | | | | | | 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`.
* coverity/74362: Initialized Array using ARRAY_DICT_INITVictor Fonseca2014-11-01
|
* job: Let job_start callers to selectively ignore stdioThiago de Arruda2014-10-31
| | | | | | | | Passing NULL as the callback for stdout/stderr will result in job_start ignoring stdout/stderr, respectively. A 'writable' boolean argument was also added, and when false `job_start` will ignore stdin. Also, refactor os_system to allow passing NULL as the `output` argument.
* msgpack-rpc: Terminate server->client calls when the channel closesThiago de Arruda2014-10-28
|
* channel: fix `REQ` definition for msgpack-rpc loggingThiago de Arruda2014-10-28
|
* msgpack-rpc: Improve logging of msgpack-rpc messagesThiago de Arruda2014-10-23
| | | | | | | | | | - Expose more logging control from the log.c module(get log stream and omit newlines) - Remove logging from the generated functions in msgpack-gen.lua - Refactor channel.c/helpers.c to log every msgpack-rpc payload using msgpack_object_print(a helper function from msgpack.h) - Remove the api_stringify function, it was only useful for logging msgpack-rpc which is now handled by msgpack_object_print.
* msgpack-rpc: Fix error handling and leak in call_request_handlerThiago de Arruda2014-10-23
| | | | | Free the arguments array after sending the response and also avoid double-sending responses in cases of errors.
* msgpack-rpc: Ensure stdio channels are properly closedThiago de Arruda2014-10-23
| | | | | | When stdio was closed, parse_msgpack was called with eof == true, with caused a free_channel call. To ensure the correct behavior for all types of channels, the close_channel must be called before free_channel.
* debug: Improve debugging of msgpack-rpc requestsThiago de Arruda2014-10-22
| | | | | | - Add the api_stringify function to display API objects - Use api_stringify to display request arguments and return values in DLOG statements.
* compilation: Add -Wconversion to more files and validate CONV_SOURCESThiago de Arruda2014-10-21
| | | | | | 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)
* msgpack-rpc: Allow selective deferral API callsThiago de Arruda2014-10-21
| | | | | | | | | | | | | Since all API functions now run immediately after a msgpack-rpc request is parsed by libuv callbacks, a mechanism was added to override this behavior and allow certain functions to run in Nvim main loop. The mechanism is simple: Any API function tagged with the FUNC_ATTR_DEFERRED (a "dummy" attribute only used by msgpack-gen.lua) will be called when Nvim main loop receives a K_EVENT key. To implement this mechanism it was necessary some restructuration on the msgpack-rpc modules, especially in the msgpack-gen.lua script.