Refine SrsHttpUri.get_uri_field, without depends on http parser.

pull/1651/head
winlin 6 years ago
parent 8bc77387ff
commit b285029e15

@ -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…
Cancel
Save