增加HTTP解析层目录结构,增加插件自注册功能。
* 增加HTTP解析层目录结构,集成CMakeLists.txt编译文件; * 调整编译顺序,先编译插件再编译平台; * 增加TFE_PLUGIN_REGISTER宏,在TFE启动时自注册插件; * 修改了stream_open接口,在插件流初始化接口不传入数据。
This commit is contained in:
@@ -86,17 +86,6 @@ struct tfe_stream_write_ctx * tfe_stream_write_frag_start(const struct tfe_strea
|
||||
int tfe_stream_write_frag(struct tfe_stream_write_ctx * w_ctx, const unsigned char * data, size_t size);
|
||||
void tfe_stream_write_frag_end(struct tfe_stream_write_ctx * w_ctx);
|
||||
|
||||
//Return 1 for identify as its traffic;
|
||||
//Return 0 for unknown traffic;
|
||||
typedef enum tfe_stream_action stream_open_cb_t(const struct tfe_stream * stream, unsigned int thread_id,
|
||||
enum tfe_conn_dir dir, const unsigned char * data, size_t len, void ** pme);
|
||||
|
||||
typedef enum tfe_stream_action stream_data_cb_t(const struct tfe_stream * stream, unsigned int thread_id,
|
||||
enum tfe_conn_dir dir, const unsigned char * data, size_t len, void ** pme);
|
||||
|
||||
typedef void stream_close_cb_t(const struct tfe_stream * stream, unsigned int thread_id,
|
||||
enum tfe_stream_close_reason reason, void ** pme);
|
||||
|
||||
void tfe_stream_detach(const struct tfe_stream * stream);
|
||||
int tfe_stream_preempt(const struct tfe_stream * stream);
|
||||
struct promise * tfe_stream_suspend(const struct tfe_stream * stream);
|
||||
@@ -106,11 +95,4 @@ void tfe_stream_resume(struct promise * promise);
|
||||
int tfe_stream_shutdown(const struct tfe_stream * stream);
|
||||
int tfe_stream_shutdown_dir(const struct tfe_stream * stream, enum tfe_conn_dir dir);
|
||||
|
||||
struct tfe_plugin
|
||||
{
|
||||
char symbol[TFE_SYMBOL_MAX];
|
||||
enum tfe_app_proto proto;
|
||||
stream_open_cb_t * on_open;
|
||||
stream_data_cb_t * on_data;
|
||||
stream_close_cb_t * on_close;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user