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
2016-12-15 15:00:08 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f6661989aff30c926831d6b22cdfe4477ac3b616
f6661989
1 parent
664844b5
fix typo for #513, #691
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
15 行增加
和
15 行删除
trunk/src/app/srs_app_http_api.cpp
trunk/src/app/srs_app_http_api.hpp
trunk/src/protocol/srs_http_stack.cpp
trunk/src/protocol/srs_http_stack.hpp
trunk/src/app/srs_app_http_api.cpp
查看文件 @
f666198
...
...
@@ -1312,7 +1312,7 @@ SrsHttpApi::SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m
:
SrsConnection
(
cm
,
fd
,
cip
)
{
mux
=
m
;
c
ros
=
new
SrsHttpCro
sMux
();
c
ors
=
new
SrsHttpCor
sMux
();
parser
=
new
SrsHttpParser
();
_srs_config
->
subscribe
(
this
);
...
...
@@ -1321,7 +1321,7 @@ SrsHttpApi::SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m
SrsHttpApi
::~
SrsHttpApi
()
{
srs_freep
(
parser
);
srs_freep
(
c
ro
s
);
srs_freep
(
c
or
s
);
_srs_config
->
unsubscribe
(
this
);
}
...
...
@@ -1367,9 +1367,9 @@ int SrsHttpApi::do_cycle()
// @see https://github.com/ossrs/srs/issues/398
skt
.
set_recv_timeout
(
SRS_HTTP_RECV_TIMEOUT_US
);
// initialize the c
ro
s, which will proxy to mux.
// initialize the c
or
s, which will proxy to mux.
bool
crossdomain_enabled
=
_srs_config
->
get_http_api_crossdomain
();
if
((
ret
=
c
ro
s
->
initialize
(
mux
,
crossdomain_enabled
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
c
or
s
->
initialize
(
mux
,
crossdomain_enabled
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
...
...
@@ -1425,7 +1425,7 @@ int SrsHttpApi::process_request(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
hm
->
is_chunked
(),
hm
->
is_infinite_chunked
());
// use default server mux to serve http request.
if
((
ret
=
c
ro
s
->
serve_http
(
w
,
r
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
c
or
s
->
serve_http
(
w
,
r
))
!=
ERROR_SUCCESS
)
{
if
(
!
srs_is_client_gracefully_close
(
ret
))
{
srs_error
(
"serve http msg failed. ret=%d"
,
ret
);
}
...
...
@@ -1440,7 +1440,7 @@ int SrsHttpApi::on_reload_http_api_crossdomain()
int
ret
=
ERROR_SUCCESS
;
bool
crossdomain_enabled
=
_srs_config
->
get_http_api_crossdomain
();
if
((
ret
=
c
ro
s
->
initialize
(
mux
,
crossdomain_enabled
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
c
or
s
->
initialize
(
mux
,
crossdomain_enabled
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
...
...
trunk/src/app/srs_app_http_api.hpp
查看文件 @
f666198
...
...
@@ -211,7 +211,7 @@ class SrsHttpApi : virtual public SrsConnection, virtual public ISrsReloadHandle
{
private
:
SrsHttpParser
*
parser
;
SrsHttpC
rosMux
*
cro
s
;
SrsHttpC
orsMux
*
cor
s
;
SrsHttpServeMux
*
mux
;
public
:
SrsHttpApi
(
IConnectionManager
*
cm
,
st_netfd_t
fd
,
SrsHttpServeMux
*
m
,
std
::
string
cip
);
...
...
trunk/src/protocol/srs_http_stack.cpp
查看文件 @
f666198
...
...
@@ -761,18 +761,18 @@ bool SrsHttpServeMux::path_match(string pattern, string path)
return
false
;
}
SrsHttpC
rosMux
::
SrsHttpCro
sMux
()
SrsHttpC
orsMux
::
SrsHttpCor
sMux
()
{
next
=
NULL
;
enabled
=
false
;
required
=
false
;
}
SrsHttpC
rosMux
::~
SrsHttpCro
sMux
()
SrsHttpC
orsMux
::~
SrsHttpCor
sMux
()
{
}
int
SrsHttpC
ro
sMux
::
initialize
(
ISrsHttpServeMux
*
worker
,
bool
cros_enabled
)
int
SrsHttpC
or
sMux
::
initialize
(
ISrsHttpServeMux
*
worker
,
bool
cros_enabled
)
{
next
=
worker
;
enabled
=
cros_enabled
;
...
...
@@ -780,7 +780,7 @@ int SrsHttpCrosMux::initialize(ISrsHttpServeMux* worker, bool cros_enabled)
return
ERROR_SUCCESS
;
}
int
SrsHttpC
ro
sMux
::
serve_http
(
ISrsHttpResponseWriter
*
w
,
ISrsHttpMessage
*
r
)
int
SrsHttpC
or
sMux
::
serve_http
(
ISrsHttpResponseWriter
*
w
,
ISrsHttpMessage
*
r
)
{
// method is OPTIONS and enable crossdomain, required crossdomain header.
if
(
r
->
is_http_options
()
&&
enabled
)
{
...
...
trunk/src/protocol/srs_http_stack.hpp
查看文件 @
f666198
...
...
@@ -443,18 +443,18 @@ private:
};
/**
* The filter http mux, directly serve the http C
RO
S requests,
* The filter http mux, directly serve the http C
OR
S requests,
* while proxy to the worker mux for services.
*/
class
SrsHttpC
ro
sMux
:
public
ISrsHttpServeMux
class
SrsHttpC
or
sMux
:
public
ISrsHttpServeMux
{
private
:
bool
required
;
bool
enabled
;
ISrsHttpServeMux
*
next
;
public
:
SrsHttpCrosMux
();
virtual
~
SrsHttpCrosMux
();
SrsHttpCorsMux
();
virtual
~
SrsHttpCorsMux
();
public
:
virtual
int
initialize
(
ISrsHttpServeMux
*
worker
,
bool
cros_enabled
);
// interface ISrsHttpServeMux
...
...
请
注册
或
登录
后发表评论