mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 03:41:55 +00:00
Refine SrsHttpUri.get_uri_field, without depends on http parser.
This commit is contained in:
parent
8bc77387ff
commit
b285029e15
2 changed files with 5 additions and 2 deletions
|
@ -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 "";
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue