1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

refine http log.

This commit is contained in:
winlin 2014-05-30 09:20:51 +08:00
parent 5273509554
commit 7166b666c8
5 changed files with 34 additions and 6 deletions

View file

@ -584,6 +584,27 @@ u_int8_t SrsHttpMessage::method()
return (u_int8_t)_header.method;
}
string SrsHttpMessage::method_str()
{
if (is_http_get()) {
return "GET";
}
if (is_http_put()) {
return "PUT";
}
if (is_http_post()) {
return "POST";
}
if (is_http_delete()) {
return "DELETE";
}
if (is_http_options()) {
return "OPTIONS";
}
return "OTHER";
}
bool SrsHttpMessage::is_http_get()
{
return _header.method == HTTP_GET;
@ -604,6 +625,11 @@ bool SrsHttpMessage::is_http_delete()
return _header.method == HTTP_DELETE;
}
bool SrsHttpMessage::is_http_options()
{
return _header.method == HTTP_OPTIONS;
}
string SrsHttpMessage::uri()
{
std::string uri = _uri->get_schema();