Skip to content

Commit

Permalink
Fix reconstruct problems for plugin module(such as MySQL)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangbin579 committed Dec 11, 2015
1 parent 632a97b commit 9ccf91b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,6 @@ Have a bug or a feature request? [Please open a new issue](https://github.com/se

## Copyright and license

Copyright 2014 under [the BSD license](LICENSE).
Copyright 2016 under [the BSD license](LICENSE).


2 changes: 1 addition & 1 deletion src/core/xcopy.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ struct tc_module_s{
bool (*check_padding)(tc_iph_t *, tc_tcph_t *);
int (*prepare_renew)(tc_sess_t *, tc_iph_t *, tc_tcph_t *);
bool (*check_pack_for_renew)(tc_sess_t *, tc_iph_t *, tc_tcph_t *);
int (*proc_when_sess_created)(tc_sess_t *, tc_iph_t *, tc_tcph_t *);
int (*proc_when_sess_created)(tc_sess_t *);
int (*proc_when_sess_destroyed)(tc_sess_t *);
int (*proc_greet)(tc_sess_t *, tc_iph_t *, tc_tcph_t *);
int (*proc_auth)(tc_sess_t *, tc_iph_t *, tc_tcph_t *);
Expand Down
9 changes: 8 additions & 1 deletion src/tcpcopy/tc_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ reconstruct_sess(tc_sess_t *s)
#if (TC_DETECT_MEMORY)
s->sm.active_timer_cnt = 2;
#endif

#if (TC_PLUGIN)
if (clt_settings.plugin && clt_settings.plugin->proc_when_sess_created) {
clt_settings.plugin->proc_when_sess_created(s);
}
#endif

tc_log_debug2(LOG_INFO, 0, "rtt:%ld,p:%u", s->rtt, ntohs(s->src_port));
utimer_disp(s, s->rtt, TYPE_RECONSTRUCT);
}
Expand Down Expand Up @@ -297,7 +304,7 @@ sess_create(tc_iph_t *ip, tc_tcph_t *tcp)
#if (TC_PLUGIN)
if (clt_settings.plugin && clt_settings.plugin->proc_when_sess_created)
{
clt_settings.plugin->proc_when_sess_created(s, ip, tcp);
clt_settings.plugin->proc_when_sess_created(s);
}
#endif
}
Expand Down

0 comments on commit 9ccf91b

Please sign in to comment.