mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
copy http-parser-2.1 into srs http stack.
This commit is contained in:
parent
fba1122835
commit
b2ae1acaa4
7 changed files with 2638 additions and 178 deletions
|
@ -30,10 +30,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <srs_core.hpp>
|
||||
|
||||
#ifdef SRS_AUTO_HTTP_CORE
|
||||
#include <http_parser.h>
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_HTTP_CORE
|
||||
|
||||
#include <map>
|
||||
|
@ -348,41 +344,6 @@ private:
|
|||
static int on_body(http_parser* parser, const char* at, size_t length);
|
||||
};
|
||||
|
||||
/**
|
||||
* used to resolve the http uri.
|
||||
*/
|
||||
class SrsHttpUri
|
||||
{
|
||||
private:
|
||||
std::string url;
|
||||
std::string schema;
|
||||
std::string host;
|
||||
int port;
|
||||
std::string path;
|
||||
std::string query;
|
||||
public:
|
||||
SrsHttpUri();
|
||||
virtual ~SrsHttpUri();
|
||||
public:
|
||||
/**
|
||||
* initialize the http uri.
|
||||
*/
|
||||
virtual int initialize(std::string _url);
|
||||
public:
|
||||
virtual std::string get_url();
|
||||
virtual std::string get_schema();
|
||||
virtual std::string get_host();
|
||||
virtual int get_port();
|
||||
virtual std::string get_path();
|
||||
virtual std::string get_query();
|
||||
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);
|
||||
};
|
||||
|
||||
class SrsHttpConn : public SrsConnection
|
||||
{
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue