summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author杨威 <[email protected]>2023-02-02 17:26:24 +0800
committer杨威 <[email protected]>2023-02-08 18:43:04 +0800
commitb692f67a1db697f0150c65978d3b63c99e8971aa (patch)
tree2ff3a3dec8ea879af7f360932f7d30c04ab3b165 /test
parentfcbeedf9d724ebab0e7f87f3310a23e2d403192e (diff)
🐞 fix(get raw meta): 修复传入的meta长度为0的bug
Diffstat (limited to 'test')
-rw-r--r--test/test_app_sapp.c111
1 files changed, 62 insertions, 49 deletions
diff --git a/test/test_app_sapp.c b/test/test_app_sapp.c
index bc22e38..2a511c2 100644
--- a/test/test_app_sapp.c
+++ b/test/test_app_sapp.c
@@ -44,8 +44,8 @@ typedef struct{
int test_bridge_id;
}test_app_val_t;
-/* ����һЩȫ�ֱ���, �и��ֲ�ͬ������, ��������������ݲ���,
- �����������ɸ��������Լ�����
+/* ����һЩȫ�ֱ���, �и��ֲ�ͬ������, ��������������ݲ���,
+ �����������ɸ��������Լ�����
*/
static test_app_val_t g_test_app_val;
static const char *g_test_app_cfg_file="./etc/test_app.conf";
@@ -139,7 +139,7 @@ static void show_hierarchical_layer_stat(void)
static int update_hierarchical_layer_stat(const struct hierarchical_layer *stream_hierarchical_layer_stat)
{
- if(search_g_hierarchical_layer_stat(stream_hierarchical_layer_stat) == 0){ //不存�? �?新的流结�?
+ if(search_g_hierarchical_layer_stat(stream_hierarchical_layer_stat) == 0){ //不存�? �?新的流结�?
memcpy(&g_hierarchical_layer_stat[hierarchical_layer_stat_num], stream_hierarchical_layer_stat, sizeof(struct hierarchical_layer) * MAX_LAYER_DEPTH);
hierarchical_layer_stat_num++;
show_hierarchical_layer_stat();
@@ -208,7 +208,7 @@ void phony_protocol_get_plugid(unsigned short plugid)
phony_protocol_plugid= plugid;
}
-/* ģ�������, �������ļ�PLUGNAME=xxxʶ�� */
+/* ģ�������, �������ļ�PLUGNAME=xxxʶ�� */
char phony_protocol_test(struct streaminfo *a_tcp, void **pme, int thread_seq,void *a_packet)
{
stSessionInfo stinfo;
@@ -356,7 +356,7 @@ char test_get_pkt_tcp_opts_ext(struct streaminfo *a_tcp, void **pme, int thread
return APP_STATE_GIVEME;
}
-/* ���Ե�����ͳ�� */
+/* ���Ե�����ͳ�� */
char test_tcp_uni_stream_stats(struct streaminfo *a_tcp, void **pme, int thread_seq,void *a_packet)
{
struct tcpdetail *raw_pdetail;
@@ -371,7 +371,7 @@ char test_tcp_uni_stream_stats(struct streaminfo *a_tcp, void **pme, int thread
if(OP_STATE_CLOSE == a_tcp->opstate){
if(DIR_DOUBLE == a_tcp->dir){
- /* ֻ�������� */
+ /* ֻ�������� */
return APP_STATE_DROPME;
}
@@ -456,10 +456,10 @@ char test_set_stream_timeout(struct streaminfo *pstream, void **pme, int thread
if(pstream->opstate== OP_STATE_PENDING){
/*
for test, port 11111=timeout=11s, port 22222=timeout=22s,
- ������nc����3��udp����, �˿ڷֱ�Ϊ11111, 22222, 33333,
- ��11s֮��, 11111Ӧ�ý���,
- 22s֮��, 22222Ӧ�ý���,
- 33333����Ĭ��ȫ�ֳ�ʱ��̭ʱ��, �������ȫ�ֳ�ʱ��̭, Ӧ�ò������(dumpfileģʽ����).
+ ������nc����3��udp����, �˿ڷֱ�Ϊ11111, 22222, 33333,
+ ��11s֮��, 11111Ӧ�ý���,
+ 22s֮��, 22222Ӧ�ý���,
+ 33333����Ĭ��ȫ�ֳ�ʱ��̭ʱ��, �������ȫ�ֳ�ʱ��̭, Ӧ�ò������(dumpfileģʽ����).
*/
if((pstream->addr.tuple4_v4->source == ntohs(11111))
|| (pstream->addr.tuple4_v4->dest == ntohs(11111))){
@@ -1087,7 +1087,7 @@ test_set_stream_timeout(pstream, pme, thread_seq, a_packet);
}
-/* 关于网络相关字�??, 均为网络�? network order */
+/* 关于网络相关字�??, 均为网络�? network order */
struct __test_inline_vxlan_hdr{
unsigned char flags;
@@ -1095,12 +1095,12 @@ struct __test_inline_vxlan_hdr{
#if 0
unsigned char reserved[3];
#else
- unsigned char nat_type; /* 复用�?�?保留字�?? 表示NAT类型 */
+ unsigned char nat_type; /* 复用�?�?保留字�?? 表示NAT类型 */
unsigned char reserved[2];
#endif
/*--------int delim -------*/
unsigned char vlan_id_half_high;
- unsigned char link_layer_type : 4; /* 二层报文封�?�格�? */
+ unsigned char link_layer_type : 4; /* 二层报文封�?�格�? */
unsigned char vlan_id_half_low : 4;
unsigned int dir : 1;
unsigned int link_id : 6;
@@ -1447,7 +1447,7 @@ static void print_tuple4(struct streaminfo *stream)
}
-/* ����ֵ 1:���Լ��İ� 0:�����Լ��İ� -1:�������ݴ��� */
+/* ����ֵ 1:���Լ��İ� 0:�����Լ��İ� -1:�������ݴ��� */
static int check_rst_ip_new (unsigned int dip_net_order,unsigned short dport_net_order, unsigned short ipid_host_order,
unsigned short win_host_order, int iMaxRandVal, int iRandKey)
{
@@ -1463,7 +1463,7 @@ static int check_rst_ip_new (unsigned int dip_net_order,unsigned short dport_net
return 1;
}
-/* ����ֵ 1:���Լ��İ� 0:�����Լ��İ� -1:�������ݴ��� */
+/* ����ֵ 1:���Լ��İ� 0:�����Լ��İ� -1:�������ݴ��� */
static int check_rst_ip_old (unsigned int sip_net_order, unsigned int dip_net_order, unsigned short ipid,
unsigned short window, int iMaxRandVal, int iRandKey)
{
@@ -1480,7 +1480,7 @@ static int check_rst_ip_old (unsigned int sip_net_order, unsigned int dip_net_or
if (window == 0)
return 0;
- if ((iMaxRandVal - ipid + sip_net_order%window)%iRandKey != 0) // ������������
+ if ((iMaxRandVal - ipid + sip_net_order%window)%iRandKey != 0) // ������������
return 0;
int val = (iMaxRandVal - ipid + sip_net_order%window)/iRandKey;
window_compute = (unsigned short)(val+dip_net_order%iRandKey);
@@ -1488,7 +1488,7 @@ static int check_rst_ip_old (unsigned int sip_net_order, unsigned int dip_net_or
if (window_compute == 0 || window_compute == 1 )
return 1;
}
- if (window == window_compute) { // ����ȣ�������������Լ�������
+ if (window == window_compute) { // ����ȣ�������������Լ�������
return 1;
}
return 0;
@@ -1747,7 +1747,7 @@ char test_kill_connection( struct streaminfo *stream,void **pme, int thread_seq,
char ip1[16], ip2[16];
struct stream_tuple4_v4 *tuple_v4;
- if(OP_STATE_DATA != stream->opstate){ /* ֻ��DATA״̬����KILL */
+ if(OP_STATE_DATA != stream->opstate){ /* ֻ��DATA״̬����KILL */
return APP_STATE_GIVEME;
}
@@ -1888,7 +1888,7 @@ static void test_inject_tcp_pkt_with_this_hdr(struct streaminfo *stream,void **p
raw_thdr = (struct mesa_tcp_hdr *)((char *)raw_ihdr + raw_ihdr->ip_hl*4);
raw_tcp_payload_len = ntohs(raw_ihdr->ip_len) - raw_ihdr->ip_hl*4 - raw_thdr->th_off * 4;
- /* 当前包是C2S方向的GET, �?要回复一�?虚假的S2C方向的RESPONSE */
+ /* 当前包是C2S方向的GET, �?要回复一�?虚假的S2C方向的RESPONSE */
send_ihdr = (struct mesa_ip4_hdr *)pkt_header_payload;
send_thdr = (struct mesa_tcp_hdr *)((char *)send_ihdr + sizeof(struct mesa_ip4_hdr));
@@ -1992,7 +1992,7 @@ char test_inject_tcp_pkt2(struct streaminfo *stream,void **pme, int thread_seq,c
-/* ʹ���µķ����ӿ� sapp_inject_pkt()����α��� */
+/* ʹ���µķ����ӿ� sapp_inject_pkt()����α��� */
static int send_by_sapp_inject_pkt(struct streaminfo *a_tcp, const struct mesa_ip4_hdr *raw_ip4hdr)
{
#define HIJACK_RESPONSE_HDR "HTTP/1.1 200 OK\r\nServer: hijack.com\r\nContent-Length:%d\r\nContent-Type: text/html; charset=UTF-8\r\nConnection: close\r\n\r\n"
@@ -2045,7 +2045,7 @@ static int send_by_sapp_inject_pkt(struct streaminfo *a_tcp, const struct mesa_i
char MESA_inject_pkt_for_l2_l3_tcp(struct streaminfo *stream,void **pme, int thread_seq,const void *raw_pkt)
{
- const char *modify_raw_data_c2s = "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"; //C2Sԭʼ�ַ�������
+ const char *modify_raw_data_c2s = "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"; //C2Sԭʼ�ַ�������
const char *modify_inject_data_s2c = "HTTP/1.1 200 OK\r\nServer: Microsoft-IIS/8.5\r\nContent-Type: text/html\r\nContent-Length: 4000\r\n\r\n<html><pre> sapp test inject data.........";
int ret;
@@ -2058,7 +2058,7 @@ char MESA_inject_pkt_for_l2_l3_tcp(struct streaminfo *stream,void **pme, int thr
if(DIR_C2S == stream->curdir){
if(memmem(stream->ptcpdetail->pdata, stream->ptcpdetail->datalen, modify_raw_data_c2s, strlen(modify_raw_data_c2s)) != NULL){
- //������һ��get����, ������һ�����Ӧ��
+ //������һ��get����, ������һ�����Ӧ��
ret = MESA_inject_pkt(stream, modify_inject_data_s2c, 1460, raw_pkt, stream->routedir ^ 1);
if(ret < 0){
DPRINT("%s, MESA_inject_pkt S2C error!\n", printaddr(&stream->addr, thread_seq));
@@ -2067,12 +2067,12 @@ char MESA_inject_pkt_for_l2_l3_tcp(struct streaminfo *stream,void **pme, int thr
}
if(stream->ptcpdetail->serverpktnum <= 3){
- ret_flag = APP_STATE_DROPPKT;//����C2S�����һ��GET��, ��MESA_inject_pkt_for_l2_l3_tcpall()�ᷢ��һ���ٵ�
+ ret_flag = APP_STATE_DROPPKT;//����C2S�����һ��GET��, ��MESA_inject_pkt_for_l2_l3_tcpall()�ᷢ��һ���ٵ�
}
}
}else{
if(memmem(stream->ptcpdetail->pdata, stream->ptcpdetail->datalen, "<html><pre>******", strlen("<html><pre>******")) != NULL){
- /* ��һ��S2CӦ����Ѿ���α�췢��, �˴�����Ҫ */
+ /* ��һ��S2CӦ����Ѿ���α�췢��, �˴�����Ҫ */
ret_flag = APP_STATE_DROPPKT;
return APP_STATE_DROPME | ret_flag;
}
@@ -2096,12 +2096,12 @@ char MESA_inject_pkt_for_l2_l3_tcpall(struct streaminfo *stream,void **pme, int
if((DIR_C2S == stream->curdir)
&& (stream->ptcpdetail->serverpktnum == 2)
- && (stream->ptcpdetail->datalen == 0)){ /* ֻ���������ָո���ɺ�, �յ�ACK������һ��get����,������ŶԲ��� */
+ && (stream->ptcpdetail->datalen == 0)){ /* ֻ���������ָո���ɺ�, �յ�ACK������һ��get����,������ŶԲ��� */
inet_ntop(AF_INET, &stream->addr.tuple4_v4->daddr, server_ip, 32);
DSPRINT(raw_data_c2s, modify_inject_data_c2s, server_ip);
if(strlen(raw_data_c2s) != 197){
- DPRINT("MESA_inject_pkt_for_l2_l3_tcpall(), C2S inject len is not 197, %d\n", (int)strlen(raw_data_c2s)); //Ҫ���DZ������������һ��, ������SEQ���ܲ���
+ DPRINT("MESA_inject_pkt_for_l2_l3_tcpall(), C2S inject len is not 197, %d\n", (int)strlen(raw_data_c2s)); //Ҫ���DZ������������һ��, ������SEQ���ܲ���
return APP_STATE_DROPME;
}
ret = MESA_inject_pkt(stream, raw_data_c2s, strlen(raw_data_c2s), raw_pkt, stream->routedir);
@@ -2202,7 +2202,7 @@ char test_sapp_inject_pkt_reverse_dir(struct streaminfo *stream,void **pme, int
static struct streaminfo *g_polling_stream = NULL;
char polling_inject_tcpall_entry(struct streaminfo *stream,void **pme, int thread_seq,const void *raw_pkt)
{
- /* polling_inject_tcp_entry��polling������, �ò���stream, ��tcpall_entry����ȫ�ֱ���g_polling_stream,�Ի�ȡij���������� */
+ /* polling_inject_tcp_entry��polling������, �ò���stream, ��tcpall_entry����ȫ�ֱ���g_polling_stream,�Ի�ȡij���������� */
if((OP_STATE_DATA == stream->pktstate) && (stream->addr.tuple4_v4->dest == htons(22))){
DPRINT("update polling stream %p: %s \n", stream, printaddr(&stream->addr, thread_seq));
@@ -2664,7 +2664,7 @@ char test_get_rawpkt_opt_from_streaminfo(struct streaminfo *f_stream,unsigned ch
int tot_len = -1, this_layer_remain_len = -1;
int ret;
- if((OP_STATE_DATA != f_stream->opstate) && (OP_STATE_DATA != f_stream->pktstate)){ /* ��ͬʱ���ص�tcp,tcpall */
+ if((OP_STATE_DATA != f_stream->opstate) && (OP_STATE_DATA != f_stream->pktstate)){ /* ��ͬʱ���ص�tcp,tcpall */
return APP_STATE_GIVEME;
}
@@ -2739,7 +2739,7 @@ char stream_bridge_tcp_entry(struct streaminfo *pstream,void **pme, int thread_s
}
if(OP_STATE_CLOSE == pstream->opstate){
- /* tcp�Ƚ���, �������� */
+ /* tcp�Ƚ���, �������� */
void *data = calloc(1, 100);
strncpy(data, "abcdefg1234567", 100);
stream_bridge_async_data_put(pstream, bridge_id, data);
@@ -2916,20 +2916,20 @@ char TEST_TCP_LOST(struct streaminfo *a_tcp, void **pme, int thread_seq,void *a
if(a_tcp->ptcpdetail->datalen > 0){
ipv4_hdr = (const struct mesa_ip4_hdr *)a_packet;
tcp_hdr = (const struct mesa_tcp_hdr *)((char *)ipv4_hdr + ipv4_hdr->ip_hl * 4);
- pkt_raw_data = (char *)tcp_hdr + tcp_hdr->th_off * 4; /* ���ݰ�ԭʼ����ָ�� */
- /* �����ش�׷�����ݵ�ԭ��, ƽ̨�����������a_tcp->ptcpdetail->pdata����һ������pkt_raw_data, �������ƫ���� */
+ pkt_raw_data = (char *)tcp_hdr + tcp_hdr->th_off * 4; /* ���ݰ�ԭʼ����ָ�� */
+ /* �����ش�׷�����ݵ�ԭ��, ƽ̨�����������a_tcp->ptcpdetail->pdata����һ������pkt_raw_data, �������ƫ���� */
actual_data_seq = ntohl(tcp_hdr->th_seq) + ((char *)a_tcp->ptcpdetail->pdata - pkt_raw_data);
DPRINT("stream:%s, dir:%d, pkt-seq:%u, actual-data-seq:%u\n", printaddr(&a_tcp->addr, a_tcp->threadnum),a_tcp->curdir, ntohl(tcp_hdr->th_seq), actual_data_seq);
if(DIR_C2S == a_tcp->curdir){
- /* ����ʵ����� == ���ϴμ���ó�������Ӧ�õ������ + ���μ���ó��Ķ������� */
+ /* ����ʵ����� == ���ϴμ���ó�������Ӧ�õ������ + ���μ���ó��Ķ������� */
if(actual_data_seq != tcp_status->seq_next_c2s + a_tcp->ptcpdetail->lostlen){
DPRINT("\033[41mstream:%s, seq check fail!\033[0m\n", printaddr(&a_tcp->addr, a_tcp->threadnum));
//assert(0);
goto err_exit;
}
- /* ��һ���ڴ��������: ��ǰʵ����� + ʵ�����ݳ��� */
+ /* ��һ���ڴ��������: ��ǰʵ����� + ʵ�����ݳ��� */
tcp_status->seq_next_c2s = actual_data_seq + a_tcp->ptcpdetail->datalen;
}else{
if(actual_data_seq != tcp_status->seq_next_s2c + a_tcp->ptcpdetail->lostlen){
@@ -2937,7 +2937,7 @@ char TEST_TCP_LOST(struct streaminfo *a_tcp, void **pme, int thread_seq,void *a
//assert(0);
goto err_exit;
}
- /* ��һ���ڴ��������: ��ǰʵ����� + ʵ�����ݳ��� */
+ /* ��һ���ڴ��������: ��ǰʵ����� + ʵ�����ݳ��� */
tcp_status->seq_next_s2c = actual_data_seq + a_tcp->ptcpdetail->datalen;
}
}
@@ -3172,22 +3172,22 @@ char RST_STREAM(struct streaminfo *a_tcp, void **pme, int thread_seq,void *a_pa
if((sport_host >= 10000) && (sport_host <= 19999)){
if(DIR_C2S == a_tcp->curdir){
- RST_STREAM_C2S(a_tcp, pme, thread_seq, a_packet); /* C2Sԭʼ������C2Sע��RST */
+ RST_STREAM_C2S(a_tcp, pme, thread_seq, a_packet); /* C2Sԭʼ������C2Sע��RST */
DPRINT("inject C2S rst by raw C2S pkt\n");
}
}else if((sport_host >= 20000) && (sport_host <= 29999)){
if(DIR_C2S == a_tcp->curdir){
- RST_STREAM_S2C(a_tcp, pme, thread_seq, a_packet); /* C2Sԭʼ������S2Cע��RST */
+ RST_STREAM_S2C(a_tcp, pme, thread_seq, a_packet); /* C2Sԭʼ������S2Cע��RST */
DPRINT("inject S2C rst by raw C2S pkt\n");
}
}else if((sport_host >= 30000) && (sport_host <= 39999)){
if(DIR_S2C == a_tcp->curdir){
- RST_STREAM_C2S(a_tcp, pme, thread_seq, a_packet); /* S2Cԭʼ������C2Sע��RST */
+ RST_STREAM_C2S(a_tcp, pme, thread_seq, a_packet); /* S2Cԭʼ������C2Sע��RST */
DPRINT("inject C2S rst by raw S2C pkt\n");
}
}else if((sport_host >= 40000) && (sport_host <= 49999)){
if(DIR_S2C == a_tcp->curdir){
- RST_STREAM_S2C(a_tcp, pme, thread_seq, a_packet); /* S2Cԭʼ������S2Cע��RST */
+ RST_STREAM_S2C(a_tcp, pme, thread_seq, a_packet); /* S2Cԭʼ������S2Cע��RST */
DPRINT("inject S2C rst by raw S2C pkt\n");
}
}else{
@@ -3207,34 +3207,47 @@ char INJECT_STREAM(struct streaminfo *a_tcp, void **pme, int thread_seq,void *a
const char *inject_C2S_by_S2C = "sapp inject_C2S_by_S2C payload......";
const char *inject_S2C_by_S2C = "sapp inject_S2C_by_S2C payload......";
- if((OP_STATE_CLOSE != a_tcp->opstate) && (DIR_DOUBLE == a_tcp->dir)){
+ //if((OP_STATE_CLOSE != a_tcp->opstate) && (DIR_DOUBLE == a_tcp->dir)){
+ if((OP_STATE_CLOSE != a_tcp->opstate)){
sport_host = ntohs(a_tcp->addr.tuple4_v4->source);
-
+
+ if (a_tcp->routedir == DIR_ROUTE_UP)
+ {
+ sapp_inject_pkt(a_tcp, SIO_DEFAULT, inject_S2C_by_C2S, strlen(inject_S2C_by_C2S), a_tcp->routedir ^ 1);
+ DPRINT("Get Outbound pkt:%s, CurDir:%d, inject to S2C by raw C2S pkt, raw payload len:%d\n", printaddr(&a_tcp->addr, thread_seq), a_tcp->curdir, a_tcp->ptcpdetail->datalen);
+ }
+ else
+ {
+ sapp_inject_pkt(a_tcp, SIO_DEFAULT, inject_S2C_by_S2C, strlen(inject_S2C_by_S2C), a_tcp->routedir);
+ DPRINT("Get Inbound pkt:%s, CurDir:%d, inject S2C pkt by raw S2C pkt, raw payload len:%d\n", printaddr(&a_tcp->addr, thread_seq), a_tcp->curdir, a_tcp->ptcpdetail->datalen);
+ }
+#if 0
if((sport_host >= 10000) && (sport_host <= 19999)){
if(DIR_C2S == a_tcp->curdir){
- sapp_inject_pkt(a_tcp, SIO_DEFAULT, inject_C2S_by_C2S, strlen(inject_C2S_by_C2S), a_tcp->routedir); /* C2Sԭʼ������C2Sע�� */
+ sapp_inject_pkt(a_tcp, SIO_DEFAULT, inject_C2S_by_C2S, strlen(inject_C2S_by_C2S), a_tcp->routedir); /* C2Sԭʼ������C2Sע�� */
DPRINT("inject C2S pkt by raw C2S pkt\n");
}
}else if((sport_host >= 20000) && (sport_host <= 29999)){
if(DIR_C2S == a_tcp->curdir){
- sapp_inject_pkt(a_tcp, SIO_DEFAULT, inject_S2C_by_C2S, strlen(inject_S2C_by_C2S), a_tcp->routedir ^ 1); /* C2Sԭʼ������S2Cע�� */
+ sapp_inject_pkt(a_tcp, SIO_DEFAULT, inject_S2C_by_C2S, strlen(inject_S2C_by_C2S), a_tcp->routedir ^ 1); /* C2Sԭʼ������S2Cע�� */
DPRINT("inject S2C pkt by raw C2S pkt\n");
}
}else if((sport_host >= 30000) && (sport_host <= 39999)){
if(DIR_S2C == a_tcp->curdir){
- sapp_inject_pkt(a_tcp, SIO_DEFAULT, inject_C2S_by_S2C, strlen(inject_C2S_by_S2C), a_tcp->routedir ^ 1); /* S2Cԭʼ������C2Sע�� */
+ sapp_inject_pkt(a_tcp, SIO_DEFAULT, inject_C2S_by_S2C, strlen(inject_C2S_by_S2C), a_tcp->routedir ^ 1); /* S2Cԭʼ������C2Sע�� */
DPRINT("inject C2S pkt by raw S2C pkt\n");
}
}else if((sport_host >= 40000) && (sport_host <= 49999)){
if(DIR_S2C == a_tcp->curdir){
- sapp_inject_pkt(a_tcp, SIO_DEFAULT, inject_S2C_by_S2C, strlen(inject_S2C_by_S2C), a_tcp->routedir); /* S2Cԭʼ������S2Cע�� */
+ sapp_inject_pkt(a_tcp, SIO_DEFAULT, inject_S2C_by_S2C, strlen(inject_S2C_by_S2C), a_tcp->routedir); /* S2Cԭʼ������S2Cע�� */
DPRINT("inject S2C pkt by raw S2C pkt\n");
}
}else{
return APP_STATE_DROPME;
}
+#endif
}
-
+
return APP_STATE_GIVEME;
}
@@ -3251,7 +3264,7 @@ char TEST_STREAM(struct streaminfo *stream, void **pme, int thread_seq, const v
return APP_STATE_DROPME;
}
- int min_num = MIN(65535, g_test_app_val.ivalue1+1); //�������ļ���ȡ
+ int min_num = MIN(65535, g_test_app_val.ivalue1+1); //�������ļ���ȡ
for(i = 0; i < min_num; i++){
local_data[i] = rand();
@@ -3267,7 +3280,7 @@ char TEST_STREAM(struct streaminfo *stream, void **pme, int thread_seq, const v
return APP_STATE_GIVEME;
}
- /* ���д�㶫��, �ķ�CPU */
+ /* ���д�㶫��, �ķ�CPU */
if(datalen > 0){
for(i = 0; i < datalen; i++){
result1[i] = (long)memchr(local_data, data[i], min_num);
@@ -3487,7 +3500,7 @@ char POLLING_ENTRY(struct streaminfo *stream, void **pme, int thread_seq,void *
extern long long sapp_random(void);
char fake_deadlock(struct streaminfo *pstream,void **pme, int thread_seq,void *a_packet)
{
- /* ����������߳�, ģ������ */
+ /* ����������߳�, ģ������ */
int opt_val_len = sizeof(int);
int tid;
int tot_thread_cnt;
@@ -3562,7 +3575,7 @@ int CHAR_INIT()
int i;
CHAR_CONFIG_INIT();
- /* �������ڳ�ʼ��ʱ����ע��project */
+ /* �������ڳ�ʼ��ʱ����ע��project */
g_test_app_val.test_project_id = project_producer_register("test_project", "struct", __fake_project_free_cb);
if(g_test_app_val.test_project_id < 0){
DPRINT("##### project_producer_register error!\n");