summaryrefslogtreecommitdiff
path: root/plugin/business/pangu-http/src/pangu_http.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/business/pangu-http/src/pangu_http.cpp')
-rw-r--r--plugin/business/pangu-http/src/pangu_http.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugin/business/pangu-http/src/pangu_http.cpp b/plugin/business/pangu-http/src/pangu_http.cpp
index 86a07ba..f55c170 100644
--- a/plugin/business/pangu-http/src/pangu_http.cpp
+++ b/plugin/business/pangu-http/src/pangu_http.cpp
@@ -1532,7 +1532,7 @@ static void http_get_client_id(const struct tfe_stream * stream, char *replace_r
tfe_stream_addr_str_split((char *)stream->str_stream_info, &sip, &sport, &dip, &dport);
- snprintf(replace_regex, TFE_SYMBOL_MAX, "%s=%s", "source_ip", sip);
+ snprintf(replace_regex, TFE_SYMBOL_MAX, "%s", sip);
}
static void http_get_subscriber_id(const struct tfe_stream * stream, char *replace_regex)
@@ -1549,7 +1549,7 @@ static void http_get_subscriber_id(const struct tfe_stream * stream, char *repla
TFE_LOG_ERROR(g_pangu_rt->local_logger, "fetch src sub id from cmsg failed, ret: %d addr: %s", ret, stream->str_stream_info);
}
}
- snprintf(replace_regex, TFE_SYMBOL_MAX, "%s=%s", "user_id", source_subscribe_id);
+ snprintf(replace_regex, TFE_SYMBOL_MAX, "%s", source_subscribe_id);
}
static int http_decoder_url(const struct tfe_stream * stream, char *rd_url, int profile_id, char **rewrite_uri)
@@ -1558,7 +1558,7 @@ static int http_decoder_url(const struct tfe_stream * stream, char *rd_url, int
char replace_with[TFE_SYMBOL_MAX]={0};
struct replace_rule *rule;
- if(strstr(rd_url, "policy_id")==NULL && strstr(rd_url, "user_id")==NULL && strstr(rd_url, "source_ip")==NULL)
+ if(strstr(rd_url, "tsg_policy_id")==NULL && strstr(rd_url, "tsg_subscriber_id")==NULL && strstr(rd_url, "tsg_client_ip")==NULL)
{
return 0;
}
@@ -1566,21 +1566,21 @@ static int http_decoder_url(const struct tfe_stream * stream, char *rd_url, int
rule = ALLOC(struct replace_rule, 3);
n_rule=0;
rule[n_rule].zone = kZoneRequestUri;
- rule[n_rule].find = tfe_strdup("policy_id={{tsg_policy_id}}");
- snprintf(replace_with, TFE_SYMBOL_MAX, "policy_id=%d", profile_id);
+ rule[n_rule].find = tfe_strdup("{{tsg_policy_id}}");
+ snprintf(replace_with, TFE_SYMBOL_MAX, "%d", profile_id);
rule[n_rule].replace_with = tfe_strdup(replace_with);
n_rule=1;
memset(replace_with, TFE_SYMBOL_MAX, 0);
rule[n_rule].zone = kZoneRequestUri;
- rule[n_rule].find = tfe_strdup("user_id={{tsg_subscriber_id}}");
+ rule[n_rule].find = tfe_strdup("{{tsg_subscriber_id}}");
http_get_subscriber_id(stream, replace_with);
rule[n_rule].replace_with = tfe_strdup(replace_with);
n_rule=2;
memset(replace_with, TFE_SYMBOL_MAX, 0);
rule[n_rule].zone = kZoneRequestUri;
- rule[n_rule].find = tfe_strdup("source_ip={{tsg_client_ip}}");
+ rule[n_rule].find = tfe_strdup("{{tsg_client_ip}}");
http_get_client_id(stream, replace_with);
rule[n_rule].replace_with = tfe_strdup(replace_with);