TSG-21649 修复client_administrative_area字段乱码问题以及Edit Element处理多json问题
This commit is contained in:
@@ -300,6 +300,7 @@ typedef void (http_session_end_cb)(const struct tfe_stream * stream,
|
||||
struct http_field_name * http_field_name_duplicate(const struct http_field_name * orig);
|
||||
int http_field_name_compare(const struct http_field_name * lvalue, const struct http_field_name * rvalue);
|
||||
const char * http_field_name_to_string(const struct http_field_name * field);
|
||||
enum tfe_http_std_field http_field_name_to_std_field(const char * field_name, size_t field_name_len);
|
||||
void http_field_name_destory(struct http_field_name *);
|
||||
|
||||
/* Tools functions for standard HTTP method */
|
||||
|
||||
@@ -110,6 +110,19 @@ struct http_field_name * http_field_construct_from_string(const char * str_field
|
||||
return NULL;
|
||||
}
|
||||
|
||||
enum tfe_http_std_field http_field_name_to_std_field(const char * field_name, size_t field_name_len)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
for (i = 1; i < __str_std_header_field_map_size; i++)
|
||||
{
|
||||
if (field_name_len == strlen(__str_std_header_field_map[i]) && !strncasecmp(field_name, __str_std_header_field_map[i], field_name_len))
|
||||
{
|
||||
return (enum tfe_http_std_field)i;
|
||||
}
|
||||
}
|
||||
return TFE_HTTP_UNKNOWN_FIELD;
|
||||
}
|
||||
|
||||
const char * http_field_name_to_string(const struct http_field_name * field)
|
||||
{
|
||||
if (field->field_id != TFE_HTTP_UNKNOWN_FIELD) return __str_std_header_field_map[field->field_id];
|
||||
|
||||
Reference in New Issue
Block a user