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.
|
||||
_keep_alive = true;
|
||||
type_ = 0;
|
||||
|
||||
schema_ = "http";
|
||||
}
|
||||
|
||||
SrsHttpMessage::~SrsHttpMessage()
|
||||
|
@ -416,7 +418,8 @@ srs_error_t SrsHttpMessage::set_url(string url, bool allow_jsonp)
|
|||
|
||||
void SrsHttpMessage::set_https(bool v)
|
||||
{
|
||||
_uri->set_schema(v? "https" : "http");
|
||||
schema_ = v? "https" : "http";
|
||||
_uri->set_schema(schema_);
|
||||
}
|
||||
|
||||
ISrsConnection* SrsHttpMessage::connection()
|
||||
|
@ -429,6 +432,11 @@ void SrsHttpMessage::set_connection(ISrsConnection* conn)
|
|||
owner_conn = conn;
|
||||
}
|
||||
|
||||
string SrsHttpMessage::schema()
|
||||
{
|
||||
return schema_;
|
||||
}
|
||||
|
||||
uint8_t SrsHttpMessage::method()
|
||||
{
|
||||
if (jsonp && !jsonp_method.empty()) {
|
||||
|
|
|
@ -120,6 +120,7 @@ private:
|
|||
// Whether the body is chunked.
|
||||
bool chunked;
|
||||
private:
|
||||
std::string schema_;
|
||||
// The parsed url.
|
||||
std::string _url;
|
||||
// The extension of file, for example, .flv
|
||||
|
@ -152,6 +153,8 @@ public:
|
|||
virtual ISrsConnection* connection();
|
||||
virtual void set_connection(ISrsConnection* conn);
|
||||
public:
|
||||
// The schema, http or https.
|
||||
virtual std::string schema();
|
||||
virtual uint8_t method();
|
||||
virtual uint16_t status_code();
|
||||
// The method helpers.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue