diff --git a/core_server/CMakeLists.txt b/core_server/CMakeLists.txt index 90204e856c304550881d8f07960bdbeb1266ba72..9245e9bcbd41b9cc25581ef32953b62a4c5a7514 100644 --- a/core_server/CMakeLists.txt +++ b/core_server/CMakeLists.txt @@ -5,13 +5,15 @@ set(DAP_CORE_SERVER_SRCS dap_server.c dap_client/dap_client.c dap_client/dap_client_internal.c - dap_client/dap_client_remote.c) + dap_client/dap_client_remote.c + dap_client/sxmlc/sxmlc.c dap_client/sxmlc/sxmlsearch.c) set(DAP_CORE_SERVER_HEADERS dap_server.h dap_client/dap_client.h dap_client/dap_client_internal.h - dap_client/dap_client_remote.h) + dap_client/dap_client_remote.h + dap_client/sxmlc/sxmlc.h dap_client/sxmlc/sxmlsearch.h) include_directories(dap_client) @@ -19,4 +21,4 @@ add_library(${PROJECT_NAME} STATIC ${DAP_CORE_SERVER_SRCS} ${DAP_CORE_SERVER_HEA target_include_directories(dap_core_server INTERFACE . dap_client) -target_link_libraries(dap_core_server ev dap_core dap_crypto) +target_link_libraries(dap_core_server ev curl dap_core dap_crypto) diff --git a/enc_server/dap_enc_http.h b/enc_server/dap_enc_http.h index abe6f4ca0a4ed74d21ab6e33fca1d413f859875a..f4f2a733df5415c5123d7014d41faabd763fc2c6 100644 --- a/enc_server/dap_enc_http.h +++ b/enc_server/dap_enc_http.h @@ -57,7 +57,7 @@ typedef struct enc_http_delegate{ size_t response_size; size_t response_size_max; - struct enc_key * key; + struct dap_enc_key * key; struct dap_http_client *http; } enc_http_delegate_t; diff --git a/http_server/dap_http_simple.c b/http_server/dap_http_simple.c index 8da55974d8f68d4e9f0f4938ff06cb093e0850b7..33c7e1bee485ea428b5060140af41687a4f98007 100644 --- a/http_server/dap_http_simple.c +++ b/http_server/dap_http_simple.c @@ -22,9 +22,9 @@ #include <stdarg.h> #include <stdbool.h> #include <string.h> -#include "../../sources/config.h" #include "dap_common.h" +#include "dap_config.h" #include "dap_http.h" #include "dap_http_client.h" #include "dap_http_simple.h" @@ -62,6 +62,7 @@ static struct ev_loop* http_simple_loop; static ev_async async_watcher_http_simple; static pthread_mutex_t mutex_on_queue_http_response = PTHREAD_MUTEX_INITIALIZER; +uint64_t s_TTL_session_key=3600; int dap_http_simple_module_init() { @@ -132,7 +133,7 @@ void* dap_http_simple_proc(dap_http_simple_t * cl_sh) dap_enc_key_t * key = dap_enc_ks_find_http(cl_sh->http); if(key){ if( key->last_used_timestamp && ( (time(NULL) - key->last_used_timestamp ) - > my_config.TTL_session_key ) ) { + > s_TTL_session_key ) ) { enc_http_delegate_t * dg = enc_http_request_decode(cl_sh); diff --git a/http_server/dap_http_simple.h b/http_server/dap_http_simple.h index f4785894dbe3f650cb4fdff65fc808dbcac53d45..3d08c79df01f17531a9f5ab166980beb8cf7e665 100644 --- a/http_server/dap_http_simple.h +++ b/http_server/dap_http_simple.h @@ -52,8 +52,8 @@ typedef struct dap_http_simple{ #define DAP_HTTP_SIMPLE(a) ((dap_http_simple_t*) (a)->_inheritor ) -extern void dap_http_simple_proc_add(dap_http_t *sh, const char * url_path, size_t reply_size_max, dap_http_simple_callback_t cb); // Add simple processor -extern int dap_http_simple_module_init(); -extern size_t dap_http_simple_reply(dap_http_simple_t * shs, void * data, size_t data_size); -extern size_t dap_http_simple_reply_f(dap_http_simple_t * shs, const char * data, ...); +void dap_http_simple_proc_add(dap_http_t *sh, const char * url_path, size_t reply_size_max, dap_http_simple_callback_t cb); // Add simple processor +int dap_http_simple_module_init(); +size_t dap_http_simple_reply(dap_http_simple_t * shs, void * data, size_t data_size); +size_t dap_http_simple_reply_f(dap_http_simple_t * shs, const char * data, ...); #endif