修正多TCP层插件同时注册时,只调用一个插件open函数的缺陷。
This commit is contained in:
@@ -30,6 +30,7 @@ enum tfe_plugin_state
|
|||||||
struct plugin_ctx
|
struct plugin_ctx
|
||||||
{
|
{
|
||||||
enum tfe_plugin_state state;
|
enum tfe_plugin_state state;
|
||||||
|
unsigned int is_plugin_opened;
|
||||||
void * pme;
|
void * pme;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -489,14 +489,10 @@ static void __stream_bev_readcb(struct bufferevent * bev, void * arg)
|
|||||||
_stream->calling_idx = plugin_id;
|
_stream->calling_idx = plugin_id;
|
||||||
struct plugin_ctx * plug_ctx = &_stream->plugin_ctxs[plugin_id];
|
struct plugin_ctx * plug_ctx = &_stream->plugin_ctxs[plugin_id];
|
||||||
|
|
||||||
if (_stream->is_plugin_opened == 0)
|
if (p_info_iter->on_open != NULL && plug_ctx->is_plugin_opened == 0)
|
||||||
{
|
{
|
||||||
if (p_info_iter->on_open != NULL)
|
p_info_iter->on_open(&_stream->head, _stream->thread_ref->thread_id, dir, &(plug_ctx->pme));
|
||||||
{
|
plug_ctx->is_plugin_opened = 1;
|
||||||
p_info_iter->on_open(&_stream->head, _stream->thread_ref->thread_id, dir, &(plug_ctx->pme));
|
|
||||||
}
|
|
||||||
|
|
||||||
_stream->is_plugin_opened = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_info_iter->on_data != NULL)
|
if (p_info_iter->on_data != NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user