Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-05-30 09:20:51 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7166b666c84c425a25e6dfd9d410afd5ca353b09
7166b666
1 parent
52735095
refine http log.
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
34 行增加
和
6 行删除
trunk/src/app/srs_app_http.cpp
trunk/src/app/srs_app_http.hpp
trunk/src/app/srs_app_http_api.cpp
trunk/src/app/srs_app_http_conn.cpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/app/srs_app_http.cpp
查看文件 @
7166b66
...
...
@@ -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
();
...
...
trunk/src/app/srs_app_http.hpp
查看文件 @
7166b66
...
...
@@ -337,10 +337,12 @@ public:
public
:
virtual
bool
is_complete
();
virtual
u_int8_t
method
();
virtual
std
::
string
method_str
();
virtual
bool
is_http_get
();
virtual
bool
is_http_put
();
virtual
bool
is_http_post
();
virtual
bool
is_http_delete
();
virtual
bool
is_http_options
();
virtual
std
::
string
uri
();
virtual
std
::
string
url
();
virtual
std
::
string
host
();
...
...
trunk/src/app/srs_app_http_api.cpp
查看文件 @
7166b66
...
...
@@ -731,8 +731,8 @@ int SrsHttpApi::process_request(SrsSocket* skt, SrsHttpMessage* req)
return
ret
;
}
srs_trace
(
"http request parsed, method=%d, url=%s, content-length=%"
PRId64
""
,
req
->
method
(),
req
->
url
().
c_str
(),
req
->
content_length
());
srs_trace
(
"HTTP %s %s, content-length=%"
PRId64
""
,
req
->
method_str
().
c_str
(),
req
->
url
().
c_str
(),
req
->
content_length
());
// TODO: maybe need to parse the url.
std
::
string
url
=
req
->
path
();
...
...
trunk/src/app/srs_app_http_conn.cpp
查看文件 @
7166b66
...
...
@@ -514,7 +514,7 @@ int SrsHttpConn::do_cycle()
{
int
ret
=
ERROR_SUCCESS
;
srs_trace
(
"
http get peer ip success.
ip=%s"
,
ip
.
c_str
());
srs_trace
(
"
HTTP client
ip=%s"
,
ip
.
c_str
());
// initialize parser
if
((
ret
=
parser
->
initialize
(
HTTP_REQUEST
))
!=
ERROR_SUCCESS
)
{
...
...
@@ -559,8 +559,8 @@ int SrsHttpConn::process_request(SrsSocket* skt, SrsHttpMessage* req)
return
ret
;
}
srs_trace
(
"http request parsed, method=%d, url=%s, content-length=%"
PRId64
""
,
req
->
method
(),
req
->
url
().
c_str
(),
req
->
content_length
());
srs_trace
(
"HTTP %s %s, content-length=%"
PRId64
""
,
req
->
method_str
().
c_str
(),
req
->
url
().
c_str
(),
req
->
content_length
());
// TODO: maybe need to parse the url.
std
::
string
url
=
req
->
path
();
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
7166b66
...
...
@@ -99,7 +99,7 @@ int SrsRtmpConn::do_cycle()
{
int
ret
=
ERROR_SUCCESS
;
srs_trace
(
"
serve
client ip=%s"
,
ip
.
c_str
());
srs_trace
(
"
RTMP
client ip=%s"
,
ip
.
c_str
());
rtmp
->
set_recv_timeout
(
SRS_RECV_TIMEOUT_US
);
rtmp
->
set_send_timeout
(
SRS_SEND_TIMEOUT_US
);
...
...
请
注册
或
登录
后发表评论