mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine codes.
This commit is contained in:
parent
b2ae1acaa4
commit
fabcc91a0e
5 changed files with 71 additions and 1 deletions
3
trunk/src/protocol/srs_http_stack.cpp
Executable file → Normal file
3
trunk/src/protocol/srs_http_stack.cpp
Executable file → Normal file
|
@ -2989,6 +2989,9 @@ int SrsHttpUri::initialize(string _url)
|
|||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
port = 0;
|
||||
schema = host = path = query = "";
|
||||
|
||||
url = _url;
|
||||
const char* purl = url.c_str();
|
||||
|
||||
|
|
|
@ -630,6 +630,21 @@ SrsJsonAny* SrsJsonObject::ensure_property_integer(string name)
|
|||
return prop;
|
||||
}
|
||||
|
||||
SrsJsonAny* SrsJsonObject::ensure_property_number(string name)
|
||||
{
|
||||
SrsJsonAny* prop = get_property(name);
|
||||
|
||||
if (!prop) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!prop->is_number()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return prop;
|
||||
}
|
||||
|
||||
SrsJsonAny* SrsJsonObject::ensure_property_boolean(string name)
|
||||
{
|
||||
SrsJsonAny* prop = get_property(name);
|
||||
|
|
|
@ -157,6 +157,7 @@ public:
|
|||
virtual SrsJsonAny* get_property(std::string name);
|
||||
virtual SrsJsonAny* ensure_property_string(std::string name);
|
||||
virtual SrsJsonAny* ensure_property_integer(std::string name);
|
||||
virtual SrsJsonAny* ensure_property_number(std::string name);
|
||||
virtual SrsJsonAny* ensure_property_boolean(std::string name);
|
||||
virtual SrsJsonAny* ensure_property_object(std::string name);
|
||||
virtual SrsJsonAny* ensure_property_array(std::string name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue