Fix build of FW part.

Add Options response to the Rest Daemon. (mandatory by Ajax request).
This commit is contained in:
2016-05-09 23:09:31 +02:00
parent ed18b11c6a
commit b613529b6c
8 changed files with 67 additions and 66 deletions

54
3P/json/.gitignore vendored
View File

@@ -1,54 +0,0 @@
*~
*.swp
/INSTALL
.deps/
.libs/
/aclocal.m4
/autom4te.cache
/config.guess
/json_config.h
/compile
/config.log
/config.status
/config.sub
/configure
/depcomp
/doc
/install-sh
/json.pc
/json-c.pc
/json-c-uninstalled.pc
/libtool
/ltmain.sh
/Makefile
/Makefile.in
/missing
/stamp-h1
/stamp-h2
/test-driver
/tests/Makefile
/tests/Makefile.in
/tests/test1
/tests/test1Formatted
/tests/test2
/tests/test2Formatted
/tests/test4
/tests/testReplaceExisting
/tests/testSubDir
/tests/test_parse_int64
/tests/test_parse
/tests/test_cast
/tests/test_charcase
/tests/test_locale
/tests/test_null
/tests/test_printbuf
/tests/test_set_serializer
/tests/*.vg.out
/tests/*.log
/tests/*.trs
/Debug
/Release
*.lo
*.o
/libjson-c.la
/libjson.la

4
3P/json/json_config.h Normal file
View File

@@ -0,0 +1,4 @@
/* json_config.h. Generated from json_config.h.in by configure. */
/* Define to 1 if you have the <inttypes.h> header file. */
#define JSON_C_HAVE_INTTYPES_H 1

12
3P/ubus/.gitignore vendored
View File

@@ -1,12 +0,0 @@
Makefile
CMakeCache.txt
CMakeFiles
*.cmake
*.a
*.so
*.dylib
examples/server
examples/client
ubusd
ubus
install_manifest.txt

View File

@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 2.8.11)
project (ubuscli)
include (libubus)
include (libubox)
add_executable (ucli ../../../cli.c)
add_dependencies (ucli ubus)
target_link_libraries (ucli
LINK_PUBLIC
ubus
)

View File

@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 2.8.11)
project (ubusd)
include (libubus)
include (libubox)
file(
GLOB
source_files
../../../ubusd.c
../../../ubusd_id.c
../../../ubusd_obj.c
../../../ubusd_proto.c
../../../ubusd_event.c
../../../ubusd_acl.c
../../../ubusd_monitor.c
)
add_executable (ubusd ${source_files})
add_dependencies (ubusd ubus)
target_link_libraries (ubusd
LINK_PUBLIC
ubus
)

0
build/.gitkeep Normal file
View File

View File

@@ -111,6 +111,26 @@ bool UBusHandler::handleDelete (CivetServer *aServer, struct mg_connection *conn
return true;
}
/*! ----------------------------------------------------------------------------
* @fn handleOptions
*
* @brief Options Method for the Exit route.
*/
bool UBusHandler::handleOptions (CivetServer *aServer, struct mg_connection *aConn)
{
UNUSED_PARAMETER (aServer);
/* Add HTTP Headers. for the Responde. */
mg_printf (aConn, "HTTP/1.1 200 OK\r\n");
mg_printf (aConn, "Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept\r\n");
mg_printf (aConn, "Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\r\n");
mg_printf (aConn, "Access-Control-Allow-Origin: *\r\n");
return true;
}
/*! ----------------------------------------------------------------------------
* @fn Exec
*

View File

@@ -43,6 +43,7 @@ public:
bool handlePost (CivetServer *server, struct mg_connection *conn);
bool handlePut (CivetServer *server, struct mg_connection *conn);
bool handleDelete (CivetServer *server, struct mg_connection *conn);
bool handleOptions (CivetServer *aServer, struct mg_connection *aConn);
private:
bool Exec (const std::string &aCommand, const std::string &aParam,