Commit Graph

241 Commits

Author SHA1 Message Date
Přemysl Eric Janouch 4a5c818ba1
json-rpc-shell: respect the NO_COLOR env. variable 2021-07-07 19:16:00 +02:00
Přemysl Eric Janouch af5929a383
CMakeLists.txt: fix copy-pasted variable name 2020-10-30 16:48:02 +01:00
Přemysl Eric Janouch 9f5845fc51
json-rpc-shell.adoc: minor improvements
Documented envvars and added a note about XDG paths.
2020-10-30 04:21:17 +01:00
Přemysl Eric Janouch 3daf254b41
CMakeLists.txt: make this build in OpenBSD 2020-10-30 04:21:16 +01:00
Přemysl Eric Janouch c533fa2fd7
CMakeLists.txt: omit end{if,foreach} expressions
Their usefulness was almost negative.
2020-10-30 04:21:16 +01:00
Přemysl Eric Janouch 2fe2d6bc03
Bump minimum CMake version to 3.0
A nice, round number.  This allows us to remove some boilerplate.
2020-10-30 04:21:16 +01:00
Přemysl Eric Janouch df93937789
CMakeLists.txt: fix an outdated comment 2020-10-30 04:21:15 +01:00
Přemysl Eric Janouch ae447065f7
Bump liberty 2020-10-30 04:21:15 +01:00
Přemysl Eric Janouch f9e157293c
json-rpc-test-server: only return regular files
They can be symlinked.
2020-10-17 23:30:22 +02:00
Přemysl Eric Janouch 42d1ff064f
json-rpc-test-server: comment on some CGI details
There are some unresolved issues in the CGI clients
that needed a more precise description.
2020-10-17 23:09:29 +02:00
Přemysl Eric Janouch 710f8e0b2d
json-rpc-test-server: fix function names
Very obviously copied and pasted from the shell.
2020-10-16 23:55:15 +02:00
Přemysl Eric Janouch 4938ee43bd
json-rpc-test-server: try to send a 408
Also send "Connection: close" when we're closing the connection.

With HTTP/1.1 there come some responsibilities.

Surprisingly enough, the forward declaration is desirable
and the invocation a clean-up.
2020-10-15 04:59:01 +02:00
Přemysl Eric Janouch 6927d022fb
WebSocket: send a User-Agent header 2020-10-15 04:30:48 +02:00
Přemysl Eric Janouch 75b2094cdd
json-rpc-test-server: add a simple co-process mode
A disgusting copy-paste but it will have to do for now.

Closes #6
2020-10-15 03:20:20 +02:00
Přemysl Eric Janouch b3c377afdb
json-rpc-test-server: WS: fix failures to upgrade
Similar to ad1aba9, only here we return 426 to the client.
2020-10-15 00:39:27 +02:00
Přemysl Eric Janouch 4236a4943a
WebSocket: adapt to common "await" infrastructure 2020-10-14 13:37:10 +02:00
Přemysl Eric Janouch 23c728e535
Add a backend for co-processes
Targets language servers.

In this first stage, we don't need to support bi-directionality,
although it's a requirement for finishing this task.

Updates #4
2020-10-14 13:37:08 +02:00
Přemysl Eric Janouch dfe814316f
This software is no longer simple 2020-10-14 13:36:35 +02:00
Přemysl Eric Janouch efc663a178
WebSocket: some clean-up 2020-10-14 12:25:22 +02:00
Přemysl Eric Janouch 2b8f52ac72
Split out a http-parser wrapper 2020-10-14 12:25:22 +02:00
Přemysl Eric Janouch bb7ffe1da2
Simplify the FAIL macro 2020-10-14 12:25:21 +02:00
Přemysl Eric Janouch ad1aba9d22
WebSocket: fix upgrade processing
When http-parser sets the upgrade field, it checks for status code 101
and even resolves our TODO about checking the entire Connection header.
2020-10-14 09:44:46 +02:00
Přemysl Eric Janouch 0107d09abc
json-rpc-shell.adoc: document the M-Enter binding 2020-10-14 02:37:50 +02:00
Přemysl Eric Janouch 01767198f2
WebSockets -> WebSocket
This is the correct name of the protocol, usage of the word
"WebSockets" should be limited.
2020-10-14 00:03:34 +02:00
Přemysl Eric Janouch 5854ed1b32
Support reading OpenRPC documents from a file
Bump liberty, it generated incorrect help messages.
2020-10-13 21:48:24 +02:00
Přemysl Eric Janouch 63c8a79479
Factor out init_backend()
The main() function is still way too long.
2020-10-13 21:07:40 +02:00
Přemysl Eric Janouch d489362a28
json-rpc-test-server: implement rpc.discover 2020-10-13 20:54:27 +02:00
Přemysl Eric Janouch c87869bef7
Cleanup
Prevent the last fuck-up from happening again.
2020-10-13 20:30:33 +02:00
Přemysl Eric Janouch fcf65f8377
Add libedit autocompletion back in
I've mistakenly removed it in the M-Enter change.
2020-10-13 20:19:19 +02:00
Přemysl Eric Janouch d820bc2f23
Bump version, update NEWS 2020-10-13 16:03:19 +02:00
Přemysl Eric Janouch b458fc1f99
libedit: bind M-Enter to newline-insert as well 2020-10-13 15:55:37 +02:00
Přemysl Eric Janouch 0771c142fe
json-rpc-test-server: fix reading the request URI 2020-10-13 04:46:08 +02:00
Přemysl Eric Janouch 742632a931
Bump http-parser
Apparently it's reached maturity and there won't be any changes
anytime soon, making this the perfect time for an upgrade.
2020-10-13 04:35:42 +02:00
Přemysl Eric Janouch 2221828763
OpenRPC: avoid eating HTTP/transport errors 2020-10-13 04:35:32 +02:00
Přemysl Eric Janouch c2a00511c0
Document OpenRPC tab completion support
Now that it's functional in both frontends, we can flaunt it.

I still don't want to make it the default.

Closes #1
2020-10-13 04:23:28 +02:00
Přemysl Eric Janouch 2b18ebf314
Implement tab completion under libedit
I haven't tested it with real wide characters but it will have to do.
I wasn't even sure if this piece of crap could be coerced into doing
this at first, so it's a win for me.

It uses a variation of the code in degesch where we /don't/ want to
print the list of candidates on partial failure.

Updates #1
2020-10-13 03:58:26 +02:00
Přemysl Eric Janouch 5d2cd01db0
json-rpc-test-server: fix a potential memory leak 2020-10-13 02:08:53 +02:00
Přemysl Eric Janouch ee79249d23
json-rpc-shell.adoc: update WebSocket notes
https://github.com/open-rpc/client-js also uses WebSockets,
although they don't seem to support notifications (in general).
2020-10-10 05:20:31 +02:00
Přemysl Eric Janouch 160d23018a
Bump liberty
resolve_relative_runtime_unique_filename() used to have a bug.
2020-10-10 05:09:11 +02:00
Přemysl Eric Janouch fed2892ee1
Readline: add trivial OpenRPC support
So far hidden under a switch and only for this frontend.
2020-10-10 05:09:10 +02:00
Přemysl Eric Janouch 667b01cb73
Reorder help message entries a bit
Should be both more useful and more alphabetic this way.
2020-10-10 02:57:14 +02:00
Přemysl Eric Janouch 20c8578084
Fix use of possibly uninitialised memory 2020-10-10 02:57:14 +02:00
Přemysl Eric Janouch 57a3b4e990
Split make_json_rpc_call() in half 2020-10-10 02:57:13 +02:00
Přemysl Eric Janouch e4d1529b4d
Slightly refactor make_json_rpc_call() 2020-10-10 02:57:13 +02:00
Přemysl Eric Janouch 897a263ee7
Readline: make M-Enter insert a newline
Before, it was only possible with C-v C-j but it's too useful
to require such an awkward method.

There is a precedent in, e.g., zsh and fish for the new binding.
2020-10-09 20:41:37 +02:00
Přemysl Eric Janouch 84702fa47d
Fix handling terminal resizes while the terminal is suspended
GNU Readline has a misfeature.
2020-10-09 20:21:52 +02:00
Přemysl Eric Janouch b315892249
Readline: fix a dormant bug in prompt changes
For details, see a similar change in degesch from uirc3.
2020-10-09 20:17:17 +02:00
Přemysl Eric Janouch 710f5f197f
Make a release, create NEWS 2020-09-05 20:42:02 +02:00
Přemysl Eric Janouch ba68585d14
Streamline the manual page a bit
I have consulted `man 7 man-pages` but overall it's a huge mess.
2020-09-05 06:34:00 +02:00
Přemysl Eric Janouch 984e5b4e7f
Use saner defaults
So that most of the time users won't need to use any switches.

--pretty-print has been inverted into jq's --compact-output,
and --auto-id has been replaced with barely, if-at-all useful
--null-as-id.
2020-09-05 06:07:45 +02:00