diff options
| author | lishu <[email protected]> | 2019-07-04 16:38:50 +0800 |
|---|---|---|
| committer | lishu <[email protected]> | 2019-07-04 16:38:50 +0800 |
| commit | b15605d793855cad3e00ffef089181ee7283a3d1 (patch) | |
| tree | 1c46e39c91f7eadba99f50ac282fafaddf1ca5e9 /src | |
| parent | 3b46bc23958fc8b9cad333dc1185ce9484795ee6 (diff) | |
add cmake
Diffstat (limited to 'src')
| -rw-r--r-- | src/HTTP_Analyze.c | 11 | ||||
| -rw-r--r-- | src/HTTP_Message.c | 8 | ||||
| -rw-r--r-- | src/HTTP_Message_Entry.c | 3 | ||||
| -rw-r--r-- | src/HTTP_Message_Header.c | 3 | ||||
| -rw-r--r-- | src/http.h | 6 | ||||
| -rw-r--r-- | src/http_update.txt | 339 |
6 files changed, 359 insertions, 11 deletions
diff --git a/src/HTTP_Analyze.c b/src/HTTP_Analyze.c index 60ac353..12188c0 100644 --- a/src/HTTP_Analyze.c +++ b/src/HTTP_Analyze.c @@ -229,7 +229,8 @@ void http_callPluginBatch(http_parser_t* cur_http_node,struct streaminfo *a_tcp, } /*clear*/ /*clear batch*/ - for(int i=0;i<cur_http_node->parser.batch_infor->field_cnt;i++) + int i=0; + for(i=0;i<cur_http_node->parser.batch_infor->field_cnt;i++) { cur_http_node->parser.batch_infor->field[i].prot_flag = 0; cur_http_node->parser.batch_infor->field[i].buf = NULL; @@ -241,7 +242,8 @@ void http_callPluginBatch(http_parser_t* cur_http_node,struct streaminfo *a_tcp, /*clear fold buf*/ if(NULL!=cur_http_node->pbuf_fold) { - for(int j=0;j<cur_http_node->pbuf_fold->cnt;j++) + int j=0; + for(j=0;j<cur_http_node->pbuf_fold->cnt;j++) { if(NULL!=cur_http_node->pbuf_fold->fold[j].buf) { @@ -623,8 +625,9 @@ void http_releaseHttpLinkNode(http_stream *a_http_stream,struct streaminfo *a_tc { /*clear fold buf*/ if(NULL!=cur_node->pbuf_fold) - { - for(int j=0;j<cur_node->pbuf_fold->cnt;j++) + { + int j=0; + for(j=0;j<cur_node->pbuf_fold->cnt;j++) { if(NULL!=cur_node->pbuf_fold->fold[j].buf) { diff --git a/src/HTTP_Message.c b/src/HTTP_Message.c index 3aa9b4f..8586657 100644 --- a/src/HTTP_Message.c +++ b/src/HTTP_Message.c @@ -14,7 +14,7 @@ #include "MESA_htable.h" #include "field_stat.h" -static int g_iThreadNum = get_thread_count(); +static int g_iThreadNum = 1; extern http_prog_runtime_parameter_t g_http_prog_para; extern string_map_t g_http_regions[]; extern const char* g_http_method[]; @@ -136,7 +136,8 @@ long long http_region2proto_flag(const char *region, uint32 region_len) /*http content......*/ else { - for(int i=0;i<g_http_prog_para.http_region_cnt;i++) + int i=0; + for(i=0;i<g_http_prog_para.http_region_cnt;i++) { if(0==strcasecmp(g_http_prog_para.http_conf_regionname[i], region)) { @@ -267,7 +268,8 @@ int http_readMainConf(const char* filename) } int HTTP_INIT(void) -{ +{ + g_iThreadNum = get_thread_count(); memset(&g_http_prog_para,0,sizeof(http_prog_runtime_parameter_t)); if(0!=http_readMainConf("./conf/http/http_main.conf")) { diff --git a/src/HTTP_Message_Entry.c b/src/HTTP_Message_Entry.c index e474f2a..032db19 100644 --- a/src/HTTP_Message_Entry.c +++ b/src/HTTP_Message_Entry.c @@ -78,7 +78,8 @@ void http_doWithGzipData(http_parser_t *cur_http_node, struct streaminfo *a_tcp, cur_http_node->parser.append_infor.contlen = cur_http_node->session.buflen; cur_http_node->session.buf =NULL; cur_http_node->session.buflen = 0; - for (int k=0; k < result_array->result_num; k++) + int k=0; + for (k=0; k < result_array->result_num; k++) { cur_http_node->session.buf = (char*)dictator_realloc(thread_seq, cur_http_node->session.buf,cur_http_node->session.buflen+result_array->result_buff[k].size); memcpy(cur_http_node->session.buf+cur_http_node->session.buflen, diff --git a/src/HTTP_Message_Header.c b/src/HTTP_Message_Header.c index fc72042..c9ca375 100644 --- a/src/HTTP_Message_Header.c +++ b/src/HTTP_Message_Header.c @@ -337,7 +337,8 @@ static void http_reseaseHttpInforList(http_parser_t**a_http, UINT16 uncomplete_c /*clear fold buf*/ if(NULL!=cur_http_node->pbuf_fold) { - for(int j=0;j<cur_http_node->pbuf_fold->cnt;j++) + int j=0; + for(j=0;j<cur_http_node->pbuf_fold->cnt;j++) { if(NULL!=cur_http_node->pbuf_fold->fold[j].buf) { @@ -1,10 +1,12 @@ #ifndef HTTP_H_ #define HTTP_H_ + #define HTTP_H_VERSION_4_20160905 0 -//#define HTTP_H_VERSION_3_20150320 0 +//#define HTTP_H_VERSION_3_20150321 0 //20160905 add http_line2region + #ifndef uchar typedef unsigned char uchar; #endif @@ -220,7 +222,7 @@ int http_line2region(const char *line, uint32 line_len, char** region, uint32* r */ long long http_region2proto_flag(const char *region, uint32 region_len); /* -*����proto_flag����ֶ����� +*����proto_flag����ֶε����� *����ֵ��http.conf�е��ַ��� */ const char* http_proto_flag2region(long long proto_flag); diff --git a/src/http_update.txt b/src/http_update.txt new file mode 100644 index 0000000..5821530 --- /dev/null +++ b/src/http_update.txt @@ -0,0 +1,339 @@ +20190111 +����URI��http://�����б�ʽ�� +1.http_infor:is_ab_uri���� +2.ͨ������int is_absolute_uri(void* app_info)��ȡ�� +�˹�����20190111�汾֮��֧�֣���Ҫ����http.so��http.h +*************************************************************** +20190105 +֧��GET����Ĵ���������֮ǰ�Ŀո�ɾ������Ӱ��ʶ���Ѿ���ʼ��������֮����Ҫɾ���ո�������������ʼ�е�����Ԫ�أ�http_analyseHttpConnection�� +************************************************************ +20181113 +��bug��HTTP�쳣��������http��ʼ�п�����ж���������֮��buf���ͷţ�����ȷʶ����ʼ�� +************************************************************ +20170207 +1. û��host��URL=serverIP+URI +2. a_http->parser.p_urlֻ��������ȷ����URL��������URLƴ��֮ǰ���м�״̬ +************************************************************ +20161219 +1. Ӧ���б�ʶ��Ϊ�����С��п�����ƽ̨����data�������ӣ�S2C����Ϊ��C2S���¡���������������¼��־�� +************************************************************ +20160905 +1.���ֶ�Ҳ֧�������� +2.�Ƽ����δ�������� +3.�������� +ע�⣺��ʼ�����ݽ�����������ʱ��������ҵ��㣬���п��ܿ�������ݲ���ͷ�������ϸ��Ự��β�������Ƕ������ã������½��Ự�� +����tcp_seq.pcap +����Ϊ�˼��ٲ���Ҫ�Ļص�������ʼ�п��������ҵ���ص��� +************************************************************ +20160715 +1.�����ڶ����µ����� +2.g_http_prog_para.batch_field_maxnum������ҵ��������Ȥ������ +************************************************************ +201690701 +1. �ڴ�����չ�������£���չ��ʹ��hash����ʶ�� +2. ����tcp_http��ͳ�� +************************************************************ +20160620 V4 +1.���Ӱ�������ʱ��ͳ�� +************************************************************ +20160612 V4 +1.֧��\n�������д������������еĴ����� +************************************************************ +20160601 V4 +1. http_findtStartFlag http_judgeHttpMethod(method, (char*)tcp_detail->pdata, curdir)һֱ��tcp_detail->pdata����ȷ���ڴ��� +2. �����������GET֮ǰ��NULL +3. ʶ��httpflag֮�����pbuf,��Ϊ֮����Ҫ��ʼ�У�������ʱ��ʼ�д��� +4. ƽ̨C2S�ඪ���������ڶ���֮ǰS2C�ȵ���Ȼ��C2S�Ķ��������֪���� +����C2S��û�д����꣬������δ֪����S2C�͵����ˣ���ô��ʱhttp_state����C2S��״̬������S2C��������ġ�S2C��˳��C2S��״̬������ȥ�� +����Ӧ����S2C����ǰC2S��û�н�������resetC2S״̬�� +************************************************************ +20160526 +1. curdir=0 +ԭ�� +ͷ����������\r\n�������\r\n����Ϊ���µ�http_infor +chunk����Ϊ0����֮��\r\n\r\n,\r֮�������ͻ���Ϊ���µ�http_infor +����� +����http_session_seq���� +�ģ��μ��ĵ���������� +2. ��������������¼�ʱ�ͷ�http_infor�����ٵȵ�tcp��������ʱ����ͷ� +3. ��������£�����http_session_seq=-1 +4. ֧��http_batch��ʹ�òμ��ĵ� to do +5. ���������ѭ�������� to do +6. ѧ�����ֵ�Bug��tcpdata��GET URL����ҵ����õ�����content to do +7. http�������ӿ��� +8. chunk����£�content_length ��������ݽ���ʱʱ�ܳ��� +9. �Ự�У�ҵ��㲻����Ҫ�ûỰ��Ϣ����ô�Ͳ�����gzip +10.http stat����pend��close��ͳ�Ƶ����� +************************************************************ +20160301 +1.��������URL�����URL +2.����S2C�������Ĵ���ʶ�� +3.���Ӵ����������ܣ���Ҫ�벶��������ʹ�� +��־�� +FATAL +INFO:pending and close +DEBUG:uri and URL +DEBUG:connect +************************************************************ +20160128 +1.֧��deflate��ѹ�� +2.����������ʱ�����ڴ����ޱ�������KB�ڴ��realloc +************************************************************ +20160122 +1. set HTTP_DATA_END when http_clearHttpInfor and before build http_infor +************************************************************ +20151103 +1. http_region2proto_flag ת��Ϊ��Сд������֮����ƥ�� + ��ʹ�ô˺������Բ��ø��� +************************************************************ +20150917 +1.������һ��http_infor��if else����bugӰ���һ�����ݰ��ǵ���������S->C�ķ��� +************************************************************ +20150818 +1.��http_url_decode��bug +************************************************************ +20150609 +1.check mem��http_doWithGzipData +������httpͷ���������ظ�����Ϣ�� +************************************************************ +20150603 +1.����http_state�͵�ǰ�������������HTTPͷ����������ʼ�к�ͷ��: +�������� +1��http_state=DATA_BIGIN,session->buf��ֵ������ҵ��� +2����ǰ������header����������http_state< DATA_BIGIN, session->buf��ֵ������ҵ��� + +a_http->phttp_begin��ָ��http�������ݵĿ�ʼ���ߵ�ǰtcp���ݰ�����ʼλ�� +ҵ��㴦����: +http_state<= DATA_BIGIN && session->buf!=NULL,���д��� +switch(session_info->prot_flag) + { + case HTTP_STATE: + if(a_http->http_state<=HTTP_DATA_BEGIN&&a_http->http_state>=HTTP_START_LINE) + { + if(session_info->buf!=NULL) + { + fwrite(session_info->buf,session_info->buflen,1,g_hs_prog_para.fp); + } + } + } + +HTTPͷ�����ݻ�ȡ˵���� +ͷ�����ݰ�����ʼ�к�ͷ���ԭʼ���� +ͷ�����ݰ���������Ӧ������� + +2.�۵���copy������ +�����۵����ŵ������л�ɾ�����������е�\t\r\n�ո��ַ������������в�ɾ��\t\n�ո� +��ʼ���е��۵����Ų���ɾ������Ϊɾ���ո��Ӱ����ʼ�е��ж� +����������key value��ʱ���ɾ���ո�\t\r\n + +�����п�����\r \r\n \n +����\n������������ + +3. ȷ����httpЭ��֮ǰ������ҵ��� +************************************************************ +20150601 +1. ����pending��close�ĵ�����Ϣ��log_leve=20�� +2. ��bug,pendng!=close��lost,�ͷ�����û�е�ת���� +************************************************************ +20150420 +1.dig��δ��ʼ�� +************************************************************ +20150401 +1.�����۵��У�before��û������ +************************************************************ +20150330 +1.����98-122.pcap���������������Ӧ��࣬��������packet_entity_len=0 +************************************************************ +20150326 +1.�������ͷ��֮�����������ģ�����return +2.��������µĴ�����Ӧ�ð���a_tcp�ķ������ǵ�ǰ���ڲ�����a_http_stream�ķ��� +************************************************************ +20150323 +1.����conteng-length:-1����� +************************************************************ +20150320 +1.�������http_infor�������ͷŽṹ�壬��Ӧ�����ͷ�֮�������ʴ���ڴ˽ṹ���ص�mgs_status +************************************************************ +20150318 +1.��tcp�ж�����ʱ��Ӧ����DATA_BEGINʱ���ܼ���������������ȫ������ + +-------------------------------------------------------------------------------------------------------- + +************************************************************ +20140327 +1. ֧��HTTP CONNECT���� +************************************************************ +20141016 +1. ֧�ִ����İ汾�Ͳ�֧�ִ����ĺϲ������ӱ�������ȷ���Ƿ�֧��HTTP���� +2. ����HTTPͳ�ƹ���:filed_stat,�����ļ����ӣ� + /*0 �������Ļ 1��������ļ�*/ + stat_screen_print=0 + stat_file=./log/http/http_stat.log + /*0 means close stat*/ + stat_cycle=0 +************************************************************ +20141017����ͷ�ļ����� +1. HTTP_Message.h->http.h +************************************************************ +20141113 +1. ɾ��KILLME +2. http.h���Ӱ汾�� +3. ֧��˫ջ��http������ papp20141024���� + +************************************************************ +20141114 +1. ���������û�д�ungzip�Ŀ��أ�ҵ���ע�����ungzip����ôҵ��㲻���յ����� + +************************************************************ +20141121 +1. �ϲ㲻��Ҫdata�����Ǵ�ʱ�п�����over_flag״̬��ԽҪ�����ϲ� + +************************************************************ +20141201 +1. xjfd������ȥ��XJFD_PROJRCTY��أ�ά��һ�״��� +2. chraset ��Ϊmemcasemem +************************************************************ +20141202 +1. http_getRegionName�IJ�����prot_flag��Ӧ��ת��Ϊregion_id, makefile����o2 + +************************************************************ +20141203 +1. http_judgeHeaderOver realloc->dictator_realloc + +************************************************************ +20141204 +1. http.h���� V3 �汾 +1) ��ʽ�ĵ�������gzip��ѹ��,�������µĿ� +2) http.hɾ���ṹ�� +3) ����Ĭ��ungzip,Ĭ�ϲ�����TextProc,ʹ�� +4��dictator +5) �������� +6�����ṹ���� +7������ڴ�й© +8) �ú�дһ��Makefile -o2 +9) ����const +10) �����ļ�����ƣ������ֶα��ֶζ�Ҫ��д��All���ɣ����ֶΡ� +11����Сд +12) ע����Ȥ��data, ungzipdata ����ѡ�� + +qq���Ͳ��û�������������������Ҫ��һ���ֶ� + +************************************************************ +20141209 +V3�汾 +1. ɾ��http_infor�ṹ�壬����ҵ������ʹ�õı��� +2. ��Ȥ�ֶ�����������ע�ͣ��ṩALL�ֶ�,��������Ҫhttp.conf�������ֶ� �ֶ����ָı� +3. ijЩif�ж���Ϊassert +4. ����Ĭ�Ͻ�gzipѹ������ͨ�������ļ��ص���ѹ����ģ�� +5. http���Ĭ�ϲ����ӽ�ѹ���Ŀ⣬ͨ��Makefile���ӿ� +6. ��Makefile,����-O2��ѡ�� +7. ȷ�ϲ���httpЭ��֮��ֱ�ӷ��� +8. �ṩ��ҵ���ĺ�����������const������ +9. http����Ĭ�ϴ�Ŀǰ���Բ��࣬���ȶ�ʱ�ṩ���궨��رմ˹��� +10.����ע������ԭʼ���ݣ�CONTENT��ѹ������UNGZIP_CONTENT + +ҵ��������֪�� +�����ļ�main.conf��http.conf�и��� +ҵ�����Ҫ����http.h��������Ҫ��case���� +��Ҫ�������ļ�inf + +���ļ�¼�� +20141210 ����ҵ����ע���ֶΣ�����ע�ͣ���Щ������࣬��Щ��Ӧ��֧࣬��ALLע�����������ļ��е��ֶΡ� ��ѹ���ij�ʼ���� + +�Բ⣺ +�ڴ�й¶ +�ֽڶ��� +dictator_malloc +���� + +************************************************************ +20141209 +V3�汾 +1. ����˵�� +֧�ֲ�֧�ֽ�ѹ�����������ļ����ƣ� + + + +papp����stream_register.h��stream_inc�� + + +cont-length:134 +cont-range:bs 100-233/1000 + + +1. ����ָ��->���� +2. ����״̬ע��������� +3. ��ʼ�У�method res_code uriע��+����ͷ�� + ͷ������������+Ӧ�� +4. ����http����״̬ok +5. content-range��ҵ��ע�ᣬ����Ҫ����,ָ��ΪNULL���Ż�cont-range�Ľ�������ok +6. method+res_code �ṩ����ok +7. over_flag link_state chunk_state״̬ͼ ok +8. �����ж�http_judgeHttpMethod��->memcmp OK +9. ��չ�ֶΣ�����ֵ��������session�б������У�value�����д��� OK + + +20141231 �������Ĵ��� + ע��ijЩ�ֶβŻᴦ��valueֵ������HOST charset���� +20150104 ��cont-range�ֶδ�����content-range��ҵ��ע�ᣬ����Ҫ����,ָ��ΪNULL���Ż�cont-range�Ľ������� + ����http_infor���ṩ����ָ�룬��Ϊ�ṩ�����ķ��� + over_flag�ܲ��ܺϲ���over_flag== ��������������� ����˫������Ӧ����� ���߳����������������data�������ӣ�dir��1��������һ���ǵ����������Ե�����������������Ҳ��ǵ�һ�����ݰ�����˵���ûỰ���������Ա���over_flag��״̬�� + �Ĵ��룬�����������ò�Ӧ��̫� + ����http�ķ������curdir + ����ע��������״̬ע�ᡢ������ʼ��ע�ᡢӦ����ʼ��ע�� + ������������ + +20150105 �������ֲ��� + +20150106 data�������ӣ���������ʶ��������ͷŻỰ����Ϊ + +************************************************************ +20150114 +�ṩ��������ַ��������ĺ����ĺ��� +************************************************************ +20140126 +1. ����url_decode���� +2. http_infor����append_infor������http.h�ģ����ϼ��� +3. ����other�ֶΣ�http.conf������ +4. HTTP.h��������˳������ +5. �Ĵ���ģ�顣 +6. PORT_DROPPKT����ƽ̨ +************************************************************ +20150202 +1. ����ڴ�й¶�� + chunk����*offset+1 + hostй¶ԭ����Ӧ����Ϣ������λstate,Ӧ�ü���HTTP_DATA_END. +2. HTTP_RETURN_DROPPKT ����������ֻ�Ƿ��ظ�ƽ̨��DROPPKT��ԭ��һ��������ټ���������ǰ������ô���ܽ���������ԭ�����������봫������ҵ��㣬��Ҫ�����������DROPME. + + +*************************************************************** +HTTP������¼: +1.�ر��ܵĽ�gzipѹ����http_main.conf��������֧�ֽ���gzip�� +2.HTTP_ALL������ͷ���� +3.HTTP_OTHER�ǷDZ�ͷ��������� +4.��չ�ֶε�buflen��:֮��ģ����������з����� + cur_http_node->parser.append_infor.content = data+start_pos; + cur_http_node->parser.append_infor.contlen + ���е�ͷ������һ���Ĵ������ȿ�����:֮��ģ�Ҳ���Ի�������С� +5.http_state==HTTP_DATA_BEGIN��ʾͷ�������� + a_http->session.buf ��ǰhttp�Ự��ʼ�ĵط�; + a_http->session.buflen ����http�Ự��ʼ�ij��ȣ� +6.�����session.buf��HTTP_DATA_BEGINһ����ֻ��http_state״̬��һ���� +7.������:(��Ҫע��http_state���д˹���(ɾ��)) + ������ǰpkt�е��������ָ�롣�����������룬������һ��pkt����֮����롣 + ��֤�ص�ҵ�������ظ��� + + + + + + + + + + + + + + + |
