TSG-11849 tfe增加从环境变量中读入处理机ip
TSG-11742 IP Libraries统一使用.分隔地理层级 TSG-10722 日志中开始时间从解析层获取
This commit is contained in:
40
plugin/business/tsg-http/include/http_lua.h
Normal file
40
plugin/business/tsg-http/include/http_lua.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
#include <stddef.h>
|
||||
|
||||
#include <event2/buffer.h>
|
||||
|
||||
#include "pattern_replace.h"
|
||||
#include <tfe_http.h>
|
||||
#include <MESA/elua.h>
|
||||
|
||||
struct tsg_lua_script
|
||||
{
|
||||
int lua_is_cache;
|
||||
struct elua_vm **http_lua_handle;
|
||||
int (*http_lua_profile)(int profile_id, struct elua_script ***elua_ctx);
|
||||
};
|
||||
|
||||
struct tsg_script_ctx
|
||||
{
|
||||
int config_id;
|
||||
int profile_id;
|
||||
int http_req_uri;
|
||||
char *rewrite_uri;
|
||||
int execut_lua_sucess;
|
||||
struct elua_context *elua_ctx;
|
||||
enum tfe_http_event events;
|
||||
void * local_logger;
|
||||
const struct tfe_http_session *session;
|
||||
struct tfe_http_half *replacing;
|
||||
struct evbuffer *http_body;
|
||||
struct evbuffer *http_lua_body;
|
||||
int actually_executed;
|
||||
};
|
||||
|
||||
struct elua_context * http_lua_ctx_new(struct tsg_lua_script *lua_script, unsigned int thread_id);
|
||||
void http_lua_ctx_free(struct tsg_lua_script *lua_script, unsigned int thread_id, struct elua_context * lua_ctx);
|
||||
struct elua_script *http_lua_map_cache_script(struct elua_vm *vm, const char *script, size_t script_len, size_t timeout_ms);
|
||||
|
||||
size_t execute_lua_script_rule(struct tsg_lua_script *lua_script, int profile_id, struct elua_context * lua_ctx, unsigned int thread_id, void *user_data);
|
||||
int http_lua_handle_create(struct tsg_lua_script *lua_script, int thread_num, const char *name_space);
|
||||
|
||||
Reference in New Issue
Block a user