+/*
+ process a JSON RPC request
+*/
+static void jsonrpc_request(struct esp_state *esp)
+{
+ const char *path = http_local_path(esp->web, JSONRPC_SERVER);
+
+ /* Ensure we got a valid path. */
+ if (path == NULL) {
+ /* should never occur */
+ http_error(esp->web, 500, "Internal server error");
+ return;
+ }
+
+ /* Ensure that the JSON-RPC server request script exists */
+ if (!file_exist(path)) {
+ http_error_unix(esp->web, path);
+ return;
+ }
+
+ /* Call the server request script */
+ esp_request(esp, JSONRPC_SERVER);
+}
+