Merge in a JSON-RPC 2.0 test server

This commit is contained in:
Přemysl Eric Janouch 2018-10-18 07:44:09 +02:00
commit df38bcf775
Signed by: p
GPG Key ID: A0420B94F92B9493
6 changed files with 2956 additions and 2 deletions

View File

@ -70,6 +70,16 @@ include_directories (${PROJECT_BINARY_DIR})
add_executable (${PROJECT_NAME} ${PROJECT_NAME}.c http-parser/http_parser.c)
target_link_libraries (${PROJECT_NAME} ${project_libraries})
# Development tools
find_package (LibMagic)
if (LIBMAGIC_FOUND)
include_directories (${LIBMAGIC_INCLUDE_DIRS})
add_executable (json-rpc-test-server
json-rpc-test-server.c http-parser/http_parser.c)
target_link_libraries (json-rpc-test-server
${project_libraries} ${LIBMAGIC_LIBRARIES})
endif ()
# The files to be installed
include (GNUInstallDirs)
install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})

View File

@ -1,4 +1,4 @@
Copyright (c) 2014 - 2016, Přemysl Janouch <p@janouch.name>
Copyright (c) 2014 - 2018, Přemysl Janouch <p@janouch.name>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

View File

@ -67,6 +67,12 @@ Note that for versions of CMake before 2.8.9, you need to prefix `cpack` with
Run the program with `--help` to obtain usage information.
Test server
-----------
If you install development packages for libmagic, an included test server will
be built but not installed which provides a trivial JSON-RPC 2.0 service with
FastCGI, SCGI, and WebSocket interfaces. It responds to the `ping` method.
Contributing and Support
------------------------
Use https://git.janouch.name/p/json-rpc-shell to report bugs, request features,

10
cmake/FindLibMagic.cmake Normal file
View File

@ -0,0 +1,10 @@
# Public Domain
find_library (LIBMAGIC_LIBRARIES magic)
find_path (LIBMAGIC_INCLUDE_DIRS magic.h)
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (LibMagic DEFAULT_MSG
LIBMAGIC_LIBRARIES LIBMAGIC_INCLUDE_DIRS)
mark_as_advanced (LIBMAGIC_LIBRARIES LIBMAGIC_INCLUDE_DIRS)

2928
json-rpc-test-server.c Normal file

File diff suppressed because it is too large Load Diff

@ -1 +1 @@
Subproject commit bb30c7d86ef7b165c5e00cc8e0ad2e3e85b9e617
Subproject commit bca7167d037d857448cb18243425d7c61de3bdd5