]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10690: Temporary commit to work on linux build for civetweb stuff
authorShane Bryldt <astaelan@gmail.com>
Thu, 28 Sep 2017 19:15:07 +0000 (14:15 -0500)
committerShane Bryldt <astaelan@gmail.com>
Thu, 28 Sep 2017 19:15:07 +0000 (14:15 -0500)
libs/libblade/Makefile.am
libs/libblade/src/blade_restmgr.c
libs/libblade/src/include/blade.h
libs/libblade/switchblade/Makefile.am
libs/libblade/switchblade/restroot/test.lp [new file with mode: 0644]
libs/libblade/test/Makefile.am

index 13d68615f891afb80d1fc0adac581b58fafec8b8..0943a676769b0eb7b7f3375a3b7cf6385052d766 100644 (file)
@@ -3,7 +3,8 @@ EXTRA_DIST =
 SUBDIRS = . test switchblade
 AUTOMAKE_OPTIONS = subdir-objects
 
-AM_CFLAGS    += -I$(top_srcdir)/src -I$(top_srcdir)/src/include
+AM_CFLAGS    += -I$(top_srcdir)/src -I$(top_srcdir)/src/include -I$(top_srcdir)/../civetweb-1.9.1/include
+AM_LDFLAGS   += -L$(top_srcdir)/../civetweb-1.9.1
 
 noinst_LTLIBRARIES      = libunqlite.la
 libunqlite_la_SOURCES   = src/unqlite.c
@@ -13,19 +14,19 @@ libunqlite_la_LIBADD    = -lpthread
 lib_LTLIBRARIES                = libblade.la
 libblade_la_SOURCES     = src/blade.c src/blade_stack.c
 libblade_la_SOURCES     += src/blade_transportmgr.c src/blade_rpcmgr.c src/blade_routemgr.c src/blade_subscriptionmgr.c
-libblade_la_SOURCES     += src/blade_mastermgr.c src/blade_connectionmgr.c src/blade_sessionmgr.c
+libblade_la_SOURCES     += src/blade_mastermgr.c src/blade_connectionmgr.c src/blade_sessionmgr.c src/blade_restmgr.c
 libblade_la_SOURCES    += src/blade_identity.c src/blade_rpc.c src/blade_connection.c src/blade_session.c
 libblade_la_SOURCES    += src/blade_protocol.c src/blade_subscription.c src/blade_channel.c
 libblade_la_SOURCES    += src/blade_transport.c src/blade_transport_wss.c
 
 libblade_la_CFLAGS     = $(AM_CFLAGS) $(AM_CPPFLAGS)
-libblade_la_LDFLAGS     = -version-info 0:1:0 -lncurses -lpthread -lm -lconfig $(AM_LDFLAGS)
+libblade_la_LDFLAGS     = -version-info 0:1:0 -lncurses -lpthread -lm -lconfig -lcivetweb $(AM_LDFLAGS)
 libblade_la_LIBADD      = libunqlite.la
 
 library_includedir     = $(prefix)/include
 library_include_HEADERS = src/include/blade.h src/include/blade_types.h src/include/blade_stack.h
 library_include_HEADERS += src/include/blade_transportmgr.h src/include/blade_rpcmgr.h src/include/blade_routemgr.h src/include/blade_subscriptionmgr.h
-library_include_HEADERS += src/include/blade_mastermgr.h src/include/blade_connectionmgr.h src/include/blade_sessionmgr.h
+library_include_HEADERS += src/include/blade_mastermgr.h src/include/blade_connectionmgr.h src/include/blade_sessionmgr.h src/include/blade_restmgr.h
 library_include_HEADERS += src/include/blade_identity.h src/include/blade_rpc.h src/include/blade_connection.h src/include/blade_session.h
 library_include_HEADERS += src/include/blade_protocol.h src/include/blade_subscription.h src/include/blade_channel.h
 library_include_HEADERS += src/include/blade_transport.h src/include/blade_transport_wss.h
index 9f1f8b8ad9d2a5fc31974b0b8abdc2a17a44947a..f819f61a21be7d8762ab5f222abbe1365699514a 100644 (file)
@@ -1,23 +1,23 @@
 /*
  * Copyright (c) 2017, Shane Bryldt
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * * Redistributions of source code must retain the above copyright
  * notice, this list of conditions and the following disclaimer.
- * 
+ *
  * * Redistributions in binary form must reproduce the above copyright
  * notice, this list of conditions and the following disclaimer in the
  * documentation and/or other materials provided with the distribution.
- * 
+ *
  * * Neither the name of the original author; nor the names of any contributors
  * may be used to endorse or promote products derived from this software
  * without specific prior written permission.
- * 
- * 
+ *
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -85,7 +85,7 @@ KS_DECLARE(ks_status_t) blade_restmgr_create(blade_restmgr_t **brestmgrP, blade_
        blade_restmgr_t *brestmgr = NULL;
 
        ks_assert(brestmgrP);
-       
+
        ks_pool_open(&pool);
        ks_assert(pool);
 
@@ -123,7 +123,7 @@ KS_DECLARE(ks_status_t) blade_restmgr_destroy(blade_restmgr_t **brestmgrP)
 #define CONFIG_LOADSTR(k) \
 tmp = config_lookup_from(rest, k); \
 if (tmp && config_setting_type(tmp) != CONFIG_TYPE_STRING) return KS_STATUS_FAIL; \
-if (tmp) ks_hash_insert(brestmgr->config.options, (const void *)k, (void *)ks_pstrdup(pool, config_setting_get_string(tmp)));
+if (tmp) ks_hash_insert(brestmgr->config.options, (void *)k, (void *)ks_pstrdup(pool, config_setting_get_string(tmp)));
 
 ks_status_t blade_restmgr_config(blade_restmgr_t *brestmgr, config_setting_t *config)
 {
@@ -298,7 +298,7 @@ int blade_restmgr_handle_begin_request(struct mg_connection *conn)
 
 void blade_restmgr_handle_end_request(const struct mg_connection *conn, int reply_status_code)
 {
-       
+
 }
 
 int blade_restmgr_handle_log_message(const struct mg_connection *conn, const char *message)
index cbe612868b5d1a47f38a47dd9d821a95950f18f1..def7d1acf39652065b6230f2e7f323ad6357a961 100644 (file)
 
 #ifndef _BLADE_H_
 #define _BLADE_H_
+
+#define USE_STACK_SIZE 102400
+#define MAX_REQUEST_SIZE 16384
+#define USE_DUKTAPE 1
+#define USE_IPV6 1
+#define LUA_COMPAT_ALL 1
+#define USE_LUA 1
+#define USE_LUA_SQLITE3 1
+#define USE_LUA_FILE_SYSTEM 1
+#define USE_WEBSOCKET 1
+
 #include <ks.h>
 #include <sodium.h>
 #include <libconfig.h>
index 0b842ce6d1d6d16197a8dec4ef1c33cf23e8e47d..5c6be0e6bab8bad92c3562df53f282016b1a8a8a 100644 (file)
@@ -1,5 +1,5 @@
-AM_CFLAGS += -I$(abs_top_srcdir)/src/include -g -ggdb -O0
-TEST_LDADD = $(abs_top_builddir)/libblade.la -lconfig -lm -lpthread
+AM_CFLAGS += -I$(abs_top_srcdir)/src/include -g -ggdb -O0 -I$(top_srcdir)/../civetweb-1.9.1/include
+TEST_LDADD = $(abs_top_builddir)/libblade.la -L$(top_srcdir)/../civetweb-1.9.1 -lconfig -lm -lpthread -lcivetweb
 check_PROGRAMS =
 
 
diff --git a/libs/libblade/switchblade/restroot/test.lp b/libs/libblade/switchblade/restroot/test.lp
new file mode 100644 (file)
index 0000000..d3794d0
--- /dev/null
@@ -0,0 +1,14 @@
+HTTP/1.0 200 OK
+Content-Type: text/html
+
+<html><body>
+
+<p>
+<span>Today is:</span>
+<? mg.write(os.date("%A")) ?>
+</p>
+<p>
+URI is <?=mg.request_info.uri?>
+</p>
+
+</body></html>
index 1884b5847e75fb5d232c71d009832cb1697004a5..8218b74572ffc50a0ebbf95662a558f20e3d3bb0 100644 (file)
@@ -1,5 +1,5 @@
-AM_CFLAGS += -I$(abs_top_srcdir)/src/include -g -ggdb -O0
-TEST_LDADD = $(abs_top_builddir)/libblade.la -lconfig -lm -lpthread
+AM_CFLAGS += -I$(abs_top_srcdir)/src/include -g -ggdb -O0 -I$(top_srcdir)/../civetweb-1.9.1/include
+TEST_LDADD = $(abs_top_builddir)/libblade.la  -L$(top_srcdir)/../civetweb-1.9.1 -lconfig -lm -lpthread -lcivetweb
 check_PROGRAMS =