1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-12 19:31:53 +00:00

Refine SrsHttpUri.get_uri_field, without depends on http parser.

This commit is contained in:
winlin 2019-04-23 08:17:59 +08:00
parent 8bc77387ff
commit b285029e15
2 changed files with 5 additions and 2 deletions

View file

@ -3094,8 +3094,11 @@ string SrsHttpUri::get_query()
return query;
}
string SrsHttpUri::get_uri_field(string uri, http_parser_url* hp_u, http_parser_url_fields field)
string SrsHttpUri::get_uri_field(string uri, void* php_u, int ifield)
{
http_parser_url* hp_u = (http_parser_url*)php_u;
http_parser_url_fields field = (http_parser_url_fields)ifield;
if((hp_u->field_set & (1 << field)) == 0){
return "";
}

View file

@ -835,7 +835,7 @@ public:
private:
// Get the parsed url field.
// @return return empty string if not set.
virtual std::string get_uri_field(std::string uri, http_parser_url* hp_u, http_parser_url_fields field);
virtual std::string get_uri_field(std::string uri, void* hp_u, int field);
};
#endif