diff options
| author | lishu <[email protected]> | 2019-11-19 17:45:22 +0800 |
|---|---|---|
| committer | lishu <[email protected]> | 2019-11-19 17:45:22 +0800 |
| commit | c179edcda8d2b1f1d9828d08e575aba60819b3f2 (patch) | |
| tree | 9c2bd38b619005f23275ee6ea9dd5e46bdfbe453 | |
| parent | 3a62b4e3ef14e62f1e5ff55069e133f0b1858d95 (diff) | |
add http_host_parser
| -rw-r--r-- | src/HTTP_Analyze.c | 3 | ||||
| -rw-r--r-- | src/HTTP_Message.c | 3 | ||||
| -rw-r--r-- | src/HTTP_Message.h | 1 | ||||
| -rw-r--r-- | src/Makefile | 5 | ||||
| -rw-r--r-- | src/http.h | 32 | ||||
| -rw-r--r-- | src/http_update.txt | 4 |
6 files changed, 37 insertions, 11 deletions
diff --git a/src/HTTP_Analyze.c b/src/HTTP_Analyze.c index 12188c0..f567a13 100644 --- a/src/HTTP_Analyze.c +++ b/src/HTTP_Analyze.c @@ -25,7 +25,7 @@ http_prog_runtime_parameter_t g_http_prog_para; int G_HTTP_H_VERSION_3_20150320 = 0; -int G_HTTP_VERSION_4_20190128 = 0; +int G_HTTP_VERSION_4_20191112 = 0; void history() { //2014-12-09 V3.0 new documentAnalyze lib ; http.h add and delete ; @@ -101,6 +101,7 @@ void history() //2019-01-05 V4.0 //special http packet, get_span_space.pcap //2019-01-11 V4.0 //is_absolute_uri //2019-01-28 V4.0 //1. support Content-Range: bytes -154100106/154100107 2. bug:http_doWithGzipData 3. assert(session_info.buflen>=0); + //2019-11-12 V4.0 //����http_host_parser���� } /* diff --git a/src/HTTP_Message.c b/src/HTTP_Message.c index 8586657..ebc6661 100644 --- a/src/HTTP_Message.c +++ b/src/HTTP_Message.c @@ -459,6 +459,9 @@ int HTTP_INIT(void) return -1; } } + + /*http test*/ + http_test(); return 0; } diff --git a/src/HTTP_Message.h b/src/HTTP_Message.h index 1e3bb5f..a585141 100644 --- a/src/HTTP_Message.h +++ b/src/HTTP_Message.h @@ -225,6 +225,7 @@ typedef struct _http_prog_runtime_parameter_t #endif }http_prog_runtime_parameter_t; +void http_test(); #ifdef __cplusplus extern "C" { diff --git a/src/Makefile b/src/Makefile index 4ebf63a..c323322 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,7 +1,7 @@ vpath %.a ../lib vpath %.h ./inc -PAPP_PATH=/home/lishu/DDP/sapp_run/ +PAPP_PATH=/home/lishu/soq/sapp/ #CFLAGS = -g3 -Wall -fPIC -Werror -O #CFLAGS = -g3 -Wall -fPIC -O @@ -16,8 +16,9 @@ LIB = -L./lib/ LIB += -lMESA_handle_logger LIB += -lMESA_prof_load LIB += -lMESA_htable -LIB += -lMESA_field_stat +LIB += -lMESA_field_stat LIB += -ldocumentanalyze +LIB += -lhttp_parser LIB_FILE = $(wildcard ../lib/*.a) SOURCES = $(wildcard *.c) @@ -2,9 +2,12 @@ #define HTTP_H_ -#define HTTP_H_VERSION_4_20160905 0 -//#define HTTP_H_VERSION_3_20150321 0 //20160905 add http_line2region +//20191112 add http_host_parser function + +#define HTTP_H_VERSION_4_20191112 0 +//#define HTTP_H_VERSION_4_20160905 0 +//#define HTTP_H_VERSION_3_20150321 0 #ifndef uchar @@ -165,12 +168,6 @@ typedef struct _append_infor_t uint32 contlen; }append_infor_t; -typedef struct _region_t -{ - char* pdata; - uint32 datalen; -}region_t; - typedef struct _field_infor_t { long long prot_flag; //��ǰ�ֶ�flag @@ -231,6 +228,25 @@ char* http_url_decode(char *data, int* data_len); int is_absolute_uri(void* app_info); +/* +* ����˵���� +* ��һ�����ݽ���HTTP�����������ж��Ƿ���HTTPЭ�飬�����ظ�buf�������HTTP���� +* ����˵��: +* buf: �������� (�����ǵ���HTTP���ӵ�����,��֧��һ��HTTP�������ݶ�ν�����Ҳ��֧��buf�����ж��http���ӵ�����) +* buflen: �������ݵij��� +* http_dir: ����buf��������DIR_C2S or DIR_S2C +* host: �������������ݵ�ָ�� +* ����ֵ: +* >0: ��buf��HTTPЭ�����ݣ���������host����, ����host�ij��� +* 0: ��buf��HTTPЭ�����ݣ���û�н�����host���� +* -1: ��buf����HTTPЭ������ +*���� demo: +* �μ�HTTP_Parser.c�� http_host_parser_test +*/ + +int http_host_parser(const char* buf, uint32 buflen, int http_dir, char** host); + + #ifdef __cplusplus } #endif diff --git a/src/http_update.txt b/src/http_update.txt index 5821530..05f3cb0 100644 --- a/src/http_update.txt +++ b/src/http_update.txt @@ -1,3 +1,7 @@ +20191112 +1.����http������������http_host_parser +2.����HTTP_Parser.c�ļ������ڲ����������� +*************************************************************** 20190111 ����URI��http://�����б�ʽ�� 1.http_infor:is_ab_uri���� |
