aboutsummaryrefslogtreecommitdiff
path: root/client
AgeCommit message (Collapse)Author
2022-07-28fix(libacron): memory leak when received more than one framesTrumeet
API:CHANGE
2022-07-27Remove acronc/CMakeLists.txtTrumeet
2022-07-27fix(acronc): fix FreeBSD buildTrumeet
2022-07-27feat(acronc): add Windows supportTrumeet
2022-07-27fix(acronc): unable to input tokenTrumeet
2022-07-27build(acronc): switch to MesonTrumeet
2022-07-27build(libacron): subproject readyTrumeet
2022-07-27build(libacron): switch to MesonTrumeet
Meson is better on resolving dependencies on various platforms.
2022-07-27feat(acronc): add id and host to the promptTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-27fix(acronc): endif DEBUGTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-26feat(acronc): prettify cli experienceTrumeet
1. Make SIGINT interrupt the current operation by forcing stdin to listen again (because the spec currently does not specify how to send the final response, so acronc will wait forever in case of invalid commands) 2. Prettify prompt and output. Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-26fix(acronc): input <cmd><EOF> will cause illegal memory accessTrumeet
Cause: 1. stdin got cmd -> request 2. stdin got EOF -> ac_disconnect -> ac_conn becomes NULL 3. socket got response -> ac_receive(ac_conn) -> crash Conclusion: ordering issue between ac_disconnect and socket read. Solution: Best way: pause the input until command returns Cons: 1. Lost the advantage of background execution of commands (has to wait until done) 2. It is unreliable to determine if a command is done: although the current server implementation will not send anything else after an error or cmd_result, Minecraft server itself or future server implementations may. The spec does not say anything on termination. Acronc currently assumes that after receiving an error or cmd_result with the same request ID, it is done. Then, it resumes the stdin, reads the EOF, and then disconnect. Worse way: Directly call uv_read_stop before ac_disconnect Cons: It is going to lose anything, including command results. This is particularly undesirable for ad-hoc calls (i.e. echo list | acronc). Therefore, the current approach is to block and read as much as we can (until error or cmd_result), then stop reading the socket before disconnecting as a double safe. Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-26feat(acronc): support reading token from env var ACRONC_TOKENTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-26build(acronc): statically link against libacTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-26fix(acronc): code cleanupTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-26refactor(libacron/acronc/helloworld): move to separate directoriesTrumeet
The corresponding CMakeLists.txt files are still rough.
2022-07-26feat(acronc): add acronc(1), the Acron cliTrumeet
Still in early development, Windows support is incomplete. Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-25feat(libacron): support force disconnecting without writing anythingTrumeet
API:CHANGE Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-23fix(helloworld): ACRONC_DEPS not usedTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-23refactor(acronc): rename acronc to helloworldTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-23feat(acronc): guard the connection using a mutexTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-23feat(libacron/acronc): delegate socket IO to the clientTrumeet
API:CHANGE Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-23fix(libacron): Windows does not have 'm' dependencyTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-22fix(acronc): add missing \nTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-22feat(acronc): set SIGINT and SIGTERM handlers on UnixTrumeet
Otherwise ASAN does not seem to run (if terminated). Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-22feat(libacron): ac_receive(): support setting a timeoutTrumeet
API:ADD Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-22fix(libacron): use WSAGetLastError() instead of errno for WinSock error codesTrumeet
WinSock does not use errno. Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-22feat(libacron): complete Win32 error message formattingTrumeet
The former approach, strerror(3), is not working on Win32 errors (GetLastError()) or WinSock errors (WSAGetLastError()). Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-22fix(libacron): variable 'r' uninitialized in strerror2Trumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-22refactor(libacron): remove unused export.mapTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-22feat(libacron): more customized ac_connection_parametersTrumeet
API:CHANGE Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-21build(libacron): add install targetTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-21build(libacron): add static libraryTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-21fix(libacron/acronc): complete cross-platform buildTrumeet
This patch made several changes to correctly build libac on Windows: 1. Deprecated PkgConfig on Unix. On both platforms, libac requires the JSON-C CMake module to locate libraries (whether is dynamic or static) and headers. On Windows, the common practice is to statically link the library, so libac now provides setup.bat to automatically clone JSON-C and build it. In CMakeLists.txt, libac will automatically pick up the in-tree JSON-C build if it presents. Otherwise, it will use the system default's. Users can override the CMAKE_PREFIX_PATH to supply a custom JSON-C library if it is not found in-tree. 2. Switched from #include <json-c/xxx.h> to <xxx.h>, as the former (current) approach is non-standard and depends on the system header locations. The later (new) approach relies on CMake to supply header search paths, which works on Windows as well. 3. Deprecated --version-script on Unix linkers. Instead, libac now uses -fvisibility (https://gcc.gnu.org/wiki/Visibility) on GCC or LLVM, as well as __declspec(dllexport) on MSVC to export selected symbols. A new macro, LIBAC_EXPORT, is defined in incl.h (new), and all functions needed to export are marked with that macro. 4. Changed several codes (mostly socket-related) to work on Windows. 5. Massive rewrite of CMake in preparation of further installation and static library support. Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-21fix(libacron/acronc): incorrect type passed to printfTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-21fix(libacron): ac_free not returnedTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-20fix(libacron): ap_connect parameters not copied to connectionTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-20refactor(libacron): use arg.app instead of inst->app, as per wic exampleTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-20refactor(libacron): remove unused int s in ac_connectTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-20fix(libacron): JSON object not freed after deserializationTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-20docs(libacron): add library docsTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-20fix(libacron): serializer_finalize not returnedTrumeet
Signed-off-by: Trumeet <yuuta@yuuta.moe>
2022-07-20refactor(libacron): remove unused fileTrumeet
2022-07-20libac: First CommitTrumeet