1、thread_num通过tfe_proxy_get_work_thread_count()函数获得;2、每个数据包TCP负载最大长度有MTU更改为mtu-sizeof(struct mesa_tcp_hdr) - sizeof(struct mesa_ip4_hdr);

This commit is contained in:
liuyang
2018-12-12 16:40:04 +08:00
parent 6339d74779
commit 0e23a077dd
2 changed files with 23 additions and 12 deletions

View File

@@ -1,32 +1,32 @@
#include "mirror_stream.h"
#include <tfe_stream.h>
#include <tfe_utils.h>
#include <tfe_plugin.h>
#include <assert.h>
extern unsigned int tfe_proxy_get_work_thread_count(void);
int decrypt_mirror_init(struct tfe_proxy * proxy)
{
const char* filepath="./conf/tfe/decrypt_mirror.conf";
int thread_num=2;
UNUSED int ret=0;//todo: aquire from proxy;
int ret=0;
int thread_num = tfe_proxy_get_work_thread_count();
ret=mirror_stream_init(thread_num, filepath);
// assert(ret==0);
return 0;
return ret;
}
int decrypt_mirror_on_open_cb(const struct tfe_stream * stream, unsigned int thread_id,
enum tfe_conn_dir dir, void ** pme)
{
UNUSED int ret=0;
int ret=0;
ret=mirror_stream_open(thread_id, stream->addr, pme);
// assert(ret==0);
return 0;
return ret;
}
enum tfe_stream_action decrypt_mirror_on_data_cb(const struct tfe_stream * stream, unsigned int thread_id,
enum tfe_conn_dir dir, const unsigned char * data, size_t len, void ** pme)
{
UNUSED int ret=0;
int ret=0;
ret=mirror_stream_write(dir, data,len, pme, thread_id);
return ACTION_FORWARD_DATA;
}