mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Support get schema for HTTP message
This commit is contained in:
parent
af8bf67606
commit
0ccbd7c40a
2 changed files with 12 additions and 1 deletions
|
@ -325,6 +325,8 @@ SrsHttpMessage::SrsHttpMessage(ISrsReader* reader, SrsFastStream* buffer) : ISrs
|
||||||
// From HTTP/1.1, default to keep alive.
|
// From HTTP/1.1, default to keep alive.
|
||||||
_keep_alive = true;
|
_keep_alive = true;
|
||||||
type_ = 0;
|
type_ = 0;
|
||||||
|
|
||||||
|
schema_ = "http";
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsHttpMessage::~SrsHttpMessage()
|
SrsHttpMessage::~SrsHttpMessage()
|
||||||
|
@ -416,7 +418,8 @@ srs_error_t SrsHttpMessage::set_url(string url, bool allow_jsonp)
|
||||||
|
|
||||||
void SrsHttpMessage::set_https(bool v)
|
void SrsHttpMessage::set_https(bool v)
|
||||||
{
|
{
|
||||||
_uri->set_schema(v? "https" : "http");
|
schema_ = v? "https" : "http";
|
||||||
|
_uri->set_schema(schema_);
|
||||||
}
|
}
|
||||||
|
|
||||||
ISrsConnection* SrsHttpMessage::connection()
|
ISrsConnection* SrsHttpMessage::connection()
|
||||||
|
@ -429,6 +432,11 @@ void SrsHttpMessage::set_connection(ISrsConnection* conn)
|
||||||
owner_conn = conn;
|
owner_conn = conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string SrsHttpMessage::schema()
|
||||||
|
{
|
||||||
|
return schema_;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t SrsHttpMessage::method()
|
uint8_t SrsHttpMessage::method()
|
||||||
{
|
{
|
||||||
if (jsonp && !jsonp_method.empty()) {
|
if (jsonp && !jsonp_method.empty()) {
|
||||||
|
|
|
@ -120,6 +120,7 @@ private:
|
||||||
// Whether the body is chunked.
|
// Whether the body is chunked.
|
||||||
bool chunked;
|
bool chunked;
|
||||||
private:
|
private:
|
||||||
|
std::string schema_;
|
||||||
// The parsed url.
|
// The parsed url.
|
||||||
std::string _url;
|
std::string _url;
|
||||||
// The extension of file, for example, .flv
|
// The extension of file, for example, .flv
|
||||||
|
@ -152,6 +153,8 @@ public:
|
||||||
virtual ISrsConnection* connection();
|
virtual ISrsConnection* connection();
|
||||||
virtual void set_connection(ISrsConnection* conn);
|
virtual void set_connection(ISrsConnection* conn);
|
||||||
public:
|
public:
|
||||||
|
// The schema, http or https.
|
||||||
|
virtual std::string schema();
|
||||||
virtual uint8_t method();
|
virtual uint8_t method();
|
||||||
virtual uint16_t status_code();
|
virtual uint16_t status_code();
|
||||||
// The method helpers.
|
// The method helpers.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue