TSG-9422 TSG-9554 TSG-9470 修复元素编辑MARK问题, 代理支持4级或以上定位库
This commit is contained in:
@@ -2216,6 +2216,29 @@ static void http_manipulate(const struct tfe_stream * stream, const struct tfe_h
|
||||
return;
|
||||
}
|
||||
|
||||
static int get_fqdn_len(char *str_host)
|
||||
{
|
||||
char *p=NULL; int fqdn_len=0;
|
||||
|
||||
if(str_host == NULL)
|
||||
{
|
||||
goto finish;
|
||||
}
|
||||
|
||||
p=index(str_host, ':');
|
||||
if(p==NULL)
|
||||
{
|
||||
fqdn_len=strlen(str_host);
|
||||
}
|
||||
else
|
||||
{
|
||||
fqdn_len=p-str_host;
|
||||
}
|
||||
|
||||
finish:
|
||||
return fqdn_len;
|
||||
}
|
||||
|
||||
enum pangu_action http_scan(const struct tfe_http_session * session, enum tfe_http_event events,
|
||||
const unsigned char * body_frag, size_t frag_size, struct pangu_http_ctx * ctx, const struct tfe_stream * stream)
|
||||
{
|
||||
@@ -2230,10 +2253,10 @@ enum pangu_action http_scan(const struct tfe_http_session * session, enum tfe_ht
|
||||
|
||||
if (events & EV_HTTP_REQ_HDR)
|
||||
{
|
||||
const char *str_host = session->req->req_spec.host;
|
||||
if (str_host != NULL)
|
||||
char *str_host = (char *)session->req->req_spec.host;
|
||||
int str_host_length = get_fqdn_len(str_host);
|
||||
if (str_host != NULL && str_host_length != 0)
|
||||
{
|
||||
int str_host_length = (int) (strlen(session->req->req_spec.host));
|
||||
scan_ret = Maat_full_scan_string(g_pangu_rt->maat, g_pangu_rt->scan_table_id[PXY_CTRL_HTTP_FQDN],
|
||||
CHARSET_UTF8, str_host, str_host_length, result + hit_cnt, NULL, MAX_SCAN_RESULT - hit_cnt, &(ctx->scan_mid), ctx->thread_id);
|
||||
if (scan_ret > 0)
|
||||
|
||||
Reference in New Issue
Block a user