增加对BR压缩编码的支持及对应的单元测试用例
This commit is contained in:
@@ -97,6 +97,11 @@ uint16_t __hf_content_encoding_parse(const char * str_content_encoding)
|
||||
return HTTP_ACCEPT_ENCODING_X_BZIP2;
|
||||
}
|
||||
|
||||
if(strcasestr(str_content_encoding, "br") != NULL)
|
||||
{
|
||||
return HTTP_ACCEPT_ENCODING_BR;
|
||||
}
|
||||
|
||||
return HTTP_ACCEPT_ENCODING_NONE;
|
||||
}
|
||||
|
||||
@@ -109,6 +114,7 @@ const char * __hf_content_encoding_to_str(unsigned int encode)
|
||||
case HTTP_ACCEPT_ENCODING_DEFLATE: return "deflate";
|
||||
case HTTP_ACCEPT_ENCODING_BZIP2: return "bzip2";
|
||||
case HTTP_ACCEPT_ENCODING_X_BZIP2: return "x-bzip2";
|
||||
case HTTP_ACCEPT_ENCODING_BR: return "br";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
@@ -431,7 +437,7 @@ static int __parser_callback_on_body(struct http_parser * parser, const char * a
|
||||
const char * __str_stream = hf_private->session->hc_private->stream->str_stream_info;
|
||||
const char * __str_url = hf_private->session->hs_public.req->req_spec.url;
|
||||
|
||||
TFE_LOG_ERROR(g_http_plugin->access_logger, "%s %s %s, ret = %d. ", __str_stream, __str_url, __what, ret);
|
||||
TFE_LOG_ERROR(g_http_plugin->logger, "%s %s %s, ret = %d. ", __str_stream, __str_url, __what, ret);
|
||||
hf_private->is_passthrough = true; return -1;
|
||||
}
|
||||
}
|
||||
@@ -1200,7 +1206,7 @@ void __write_access_log(struct http_session_private * hs_private)
|
||||
request->major, request->minor, __str_resp_code, __str_cont_type, __str_cont_encoding,
|
||||
__str_upgrade, __str_req_passthrough, __str_resp_passthrough, __str_user_req, __str_user_resp, __str_suspend);
|
||||
|
||||
TFE_LOG_INFO(g_http_plugin->access_logger, "%s", __access_log);
|
||||
TFE_LOG_INFO(g_http_plugin->logger, "%s", __access_log);
|
||||
free(__access_log);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user