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-03-26 12:34:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ebf113958208567df77a1df98868046dbe0658cf
ebf11395
1 parent
e02293d9
fix the forward loop detect bug. change to 0.9.34
显示空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
27 行增加
和
13 行删除
trunk/src/app/srs_app_forward.cpp
trunk/src/core/srs_core.hpp
trunk/src/rtmp/srs_protocol_rtmp.cpp
trunk/src/rtmp/srs_protocol_rtmp.hpp
trunk/src/app/srs_app_forward.cpp
查看文件 @
ebf1139
...
...
@@ -97,17 +97,27 @@ int SrsForwarder::on_publish(SrsRequest* req, std::string forward_server)
tc_url
+=
req
->
app
;
// dead loop check
std
::
string
source_ep
=
req
->
vhost
;
std
::
string
source_ep
=
"rtmp://"
;
source_ep
+=
req
->
host
;
source_ep
+=
":"
;
source_ep
+=
req
->
port
;
std
::
string
dest_ep
=
vhost
;
source_ep
+=
"?vhost="
;
source_ep
+=
req
->
vhost
;
std
::
string
dest_ep
=
"rtmp://"
;
if
(
forward_server
==
"127.0.0.1"
)
{
dest_ep
+=
req
->
host
;
}
else
{
dest_ep
+=
forward_server
;
}
dest_ep
+=
":"
;
dest_ep
+=
s_port
;
dest_ep
+=
"?vhost="
;
dest_ep
+=
vhost
;
if
(
source_ep
==
dest_ep
)
{
ret
=
ERROR_SYSTEM_FORWARD_LOOP
;
srs_warn
(
"f
arder
loop detected. src=%s, dest=%s, ret=%d"
,
srs_warn
(
"f
orward
loop detected. src=%s, dest=%s, ret=%d"
,
source_ep
.
c_str
(),
dest_ep
.
c_str
(),
ret
);
return
ret
;
}
...
...
trunk/src/core/srs_core.hpp
查看文件 @
ebf1139
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "3
3
"
#define VERSION_REVISION "3
4
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "srs"
...
...
trunk/src/rtmp/srs_protocol_rtmp.cpp
查看文件 @
ebf1139
...
...
@@ -87,6 +87,7 @@ SrsRequest* SrsRequest::copy()
cp
->
app
=
app
;
cp
->
objectEncoding
=
objectEncoding
;
cp
->
pageUrl
=
pageUrl
;
cp
->
host
=
host
;
cp
->
port
=
port
;
cp
->
schema
=
schema
;
cp
->
stream
=
stream
;
...
...
@@ -111,19 +112,20 @@ int SrsRequest::discovery_app()
}
if
((
pos
=
url
.
find
(
"/"
))
!=
std
::
string
::
npos
)
{
vhost
=
url
.
substr
(
0
,
pos
);
url
=
url
.
substr
(
vhost
.
length
()
+
1
);
srs_verbose
(
"discovery vhost=%s"
,
vhost
.
c_str
());
host
=
url
.
substr
(
0
,
pos
);
url
=
url
.
substr
(
host
.
length
()
+
1
);
srs_verbose
(
"discovery host=%s"
,
host
.
c_str
());
}
port
=
RTMP_DEFAULT_PORT
;
if
((
pos
=
vhost
.
find
(
":"
))
!=
std
::
string
::
npos
)
{
port
=
vhost
.
substr
(
pos
+
1
);
vhost
=
vhost
.
substr
(
0
,
pos
);
srs_verbose
(
"discovery vhost=%s, port=%s"
,
vhost
.
c_str
(),
port
.
c_str
());
if
((
pos
=
host
.
find
(
":"
))
!=
std
::
string
::
npos
)
{
port
=
host
.
substr
(
pos
+
1
);
host
=
host
.
substr
(
0
,
pos
);
srs_verbose
(
"discovery host=%s, port=%s"
,
host
.
c_str
(),
port
.
c_str
());
}
app
=
url
;
vhost
=
host
;
srs_vhost_resolve
(
vhost
,
app
);
strip
();
...
...
trunk/src/rtmp/srs_protocol_rtmp.hpp
查看文件 @
ebf1139
...
...
@@ -46,8 +46,9 @@ class SrsPlayPacket;
/**
* the original request from client.
*/
struct
SrsRequest
class
SrsRequest
{
public
:
/**
* tcUrl: rtmp://request_vhost:port/app/stream
* support pass vhost in query string, such as:
...
...
@@ -61,6 +62,7 @@ struct SrsRequest
std
::
string
schema
;
std
::
string
vhost
;
std
::
string
host
;
std
::
string
port
;
std
::
string
app
;
std
::
string
stream
;
...
...
请
注册
或
登录
后发表评论